From 11ac7ef7a816189043c88a4a5794aebf204f634b Mon Sep 17 00:00:00 2001 From: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com> Date: Fri, 24 Mar 2023 09:38:52 +0100 Subject: [PATCH 01/32] add setter for notificationItems (#982) * add setter for notificationItems * make unit tests slightly more explicit * add from/to JSON function and use this in tests --- .../notification/NotificationRequest.java | 34 ++++++++++++++++++- .../notification/NotificationHandler.java | 7 ++-- src/test/java/com/adyen/NotificationTest.java | 16 ++++++++- 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/adyen/model/notification/NotificationRequest.java b/src/main/java/com/adyen/model/notification/NotificationRequest.java index 633a3560a..851671131 100644 --- a/src/main/java/com/adyen/model/notification/NotificationRequest.java +++ b/src/main/java/com/adyen/model/notification/NotificationRequest.java @@ -20,8 +20,11 @@ */ package com.adyen.model.notification; +import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; +import java.io.IOException; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -56,12 +59,21 @@ public void setNotificationItemContainers(List public List getNotificationItems() { - if (this.notificationItemContainers == null) { + if (notificationItemContainers == null) { return null; } return notificationItemContainers.stream().map(s -> s.getNotificationItem()).collect(Collectors.toList()); } + public void setNotificationItems(List notificationItems) { + notificationItemContainers = new ArrayList(); + for(NotificationRequestItem requestItem: notificationItems) { + NotificationRequestItemContainer requestItemContainer = new NotificationRequestItemContainer(); + requestItemContainer.setNotificationItem(requestItem); + notificationItemContainers.add(requestItemContainer); + } + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -72,4 +84,24 @@ public String toString() { sb.append("}"); return sb.toString(); } + + /** + * Create an instance of NotificationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of NotificationRequest + * @throws IOException if the JSON string is invalid with respect to NotificationRequest + */ + public static NotificationRequest fromJson(String jsonString) throws IOException { + return new Gson().fromJson(jsonString, NotificationRequest.class); + } + + /** + * Convert an instance of NotificationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return new Gson().toJson(this); + } } diff --git a/src/main/java/com/adyen/notification/NotificationHandler.java b/src/main/java/com/adyen/notification/NotificationHandler.java index 96e1cc07c..0b3494cb2 100644 --- a/src/main/java/com/adyen/notification/NotificationHandler.java +++ b/src/main/java/com/adyen/notification/NotificationHandler.java @@ -29,6 +29,8 @@ import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; +import java.io.IOException; + /** * Notification converter */ @@ -44,9 +46,8 @@ public NotificationHandler() { terminalGson = TerminalAPIGsonBuilder.create(); } - public NotificationRequest handleNotificationJson(String json) { - return GSON.fromJson(json, new TypeToken() { - }.getType()); + public NotificationRequest handleNotificationJson(String json) throws IOException { + return NotificationRequest.fromJson(json); } public GenericNotification handleMarketpayNotificationJson(String json) { diff --git a/src/test/java/com/adyen/NotificationTest.java b/src/test/java/com/adyen/NotificationTest.java index 8a2945330..6defe54be 100644 --- a/src/test/java/com/adyen/NotificationTest.java +++ b/src/test/java/com/adyen/NotificationTest.java @@ -42,6 +42,8 @@ import org.junit.Before; import org.junit.Test; +import java.io.IOException; +import java.util.ArrayList; import java.util.Collections; import java.util.Date; @@ -221,14 +223,26 @@ public void testTerminalEventNotification() throws Exception { assertEquals(EventToNotifyType.SHUTDOWN, eventNotification.getEventToNotify()); } + @Test + public void testSetNotificationItem() throws Exception { + NotificationRequest notificationRequest = readNotificationRequestFromFile("mocks/notification/authorisation-true.json"); + assertEquals("123456789", notificationRequest.getNotificationItems().get(0).getPspReference()); + NotificationRequestItem requestItem = new NotificationRequestItem(); + requestItem.setPspReference("987654321"); + ArrayList notificationRequestItems = new ArrayList(); + notificationRequestItems.add(requestItem); + notificationRequest.setNotificationItems(notificationRequestItems); + assertEquals(1, notificationRequest.getNotificationItems().size()); + assertEquals("987654321", notificationRequest.getNotificationItems().get(0).getPspReference()); + } private void assertJsonStringEquals(String firstInput, String secondInput) { JsonParser parser = new JsonParser(); assertEquals(parser.parse(firstInput), parser.parse(secondInput)); } - private NotificationRequest readNotificationRequestFromFile(String resourcePath) { + private NotificationRequest readNotificationRequestFromFile(String resourcePath) throws IOException { String json = getFileContents(resourcePath); return notificationHandler.handleNotificationJson(json); } From 6d6333937cb2caa1af2ed8e5b090582e28bbadf3 Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot <38424300+AdyenAutomationBot@users.noreply.github.com> Date: Wed, 12 Apr 2023 10:12:19 +0200 Subject: [PATCH 02/32] Update models (#984) * [create-pull-request] automated change * fixed breaking tests --------- Co-authored-by: jillingk <93914435+jillingk@users.noreply.github.com> --- .../AULocalAccountIdentification.java | 332 +++++++ .../model/balanceplatform/AccountHolder.java | 56 +- .../AccountHolderCapability.java | 52 +- .../balanceplatform/AccountHolderInfo.java | 8 +- .../AccountSupportingEntityCapability.java | 534 ++++++++++++ ...java => AdditionalBankIdentification.java} | 157 +--- .../model/balanceplatform/BalanceAccount.java | 4 +- .../balanceplatform/BalanceAccountBase.java | 469 ++++++++++ .../balanceplatform/BalanceAccountInfo.java | 4 +- .../BalanceAccountUpdateRequest.java | 4 +- ...ccountIdentificationValidationRequest.java | 217 +++++ ...alidationRequestAccountIdentification.java | 816 ++++++++++++++++++ .../CALocalAccountIdentification.java | 449 ++++++++++ .../CZLocalAccountIdentification.java | 332 +++++++ .../com/adyen/model/balanceplatform/Card.java | 8 +- .../adyen/model/balanceplatform/CardInfo.java | 8 +- .../balanceplatform/DayOfWeekRestriction.java | 316 +++++++ .../HULocalAccountIdentification.java | 298 +++++++ .../IbanAccountIdentification.java | 298 +++++++ .../com/adyen/model/balanceplatform/JSON.java | 28 +- .../MerchantNamesRestriction.java | 268 ++++++ .../NOLocalAccountIdentification.java | 298 +++++++ .../NumberAndBicAccountIdentification.java | 366 ++++++++ .../PLLocalAccountIdentification.java | 298 +++++++ .../PaginatedBalanceAccountsResponse.java | 14 +- .../balanceplatform/PaymentInstrument.java | 12 +- .../PaymentInstrumentBankAccount.java | 285 ++++++ .../PaymentInstrumentRevealInfo.java | 285 ++++++ .../model/balanceplatform/PhoneNumber.java | 13 +- .../SELocalAccountIdentification.java | 332 +++++++ .../SGLocalAccountIdentification.java | 331 +++++++ .../model/balanceplatform/StringMatch.java | 295 +++++++ .../balanceplatform/SweepConfigurationV2.java | 289 ++++++- .../balanceplatform/TransactionRule.java | 87 +- .../balanceplatform/TransactionRuleInfo.java | 87 +- .../TransactionRuleRestrictions.java | 70 +- .../UKLocalAccountIdentification.java | 332 +++++++ .../USLocalAccountIdentification.java | 415 +++++++++ .../UpdatePaymentInstrument.java | 750 ++++++++++++++++ .../balanceplatform/VerificationDeadline.java | 384 +++++++++ .../balanceplatform/VerificationError.java | 428 --------- .../AcceptTermsOfServiceResponse.java | 4 + ...CalculateTermsOfServiceStatusResponse.java | 4 + .../CapabilityProblemEntity.java | 47 +- .../CapabilityProblemEntityRecursive.java | 47 +- .../model/legalentitymanagement/Document.java | 3 +- .../GetTermsOfServiceDocumentRequest.java | 4 + .../GetTermsOfServiceDocumentResponse.java | 4 + .../legalentitymanagement/SourceOfFunds.java | 4 +- .../TermsOfServiceAcceptanceInfo.java | 4 + .../TransferInstrumentReference.java | 37 +- .../adyen/model/management/CompanyUser.java | 43 +- .../management/CreateCompanyUserRequest.java | 43 +- .../management/CreateCompanyUserResponse.java | 43 +- .../CreateCompanyWebhookRequest.java | 28 +- .../management/CreateMerchantUserRequest.java | 43 +- .../CreateMerchantWebhookRequest.java | 22 +- .../model/management/CreateUserResponse.java | 43 +- .../adyen/model/management/GooglePayInfo.java | 43 +- .../java/com/adyen/model/management/JSON.java | 3 + .../java/com/adyen/model/management/Opi.java | 4 +- .../com/adyen/model/management/OrderItem.java | 31 +- .../adyen/model/management/PayAtTable.java | 287 ++++++ .../Payment.java} | 110 +-- .../adyen/model/management/PaymentMethod.java | 38 +- .../management/PaymentMethodResponse.java | 10 + .../management/PaymentMethodSetupInfo.java | 48 +- .../model/management/TerminalSettings.java | 70 +- .../management/UpdateCompanyUserRequest.java | 84 +- .../UpdateCompanyWebhookRequest.java | 38 +- .../management/UpdateMerchantUserRequest.java | 84 +- .../UpdateMerchantWebhookRequest.java | 36 +- .../management/UpdatePaymentMethodInfo.java | 45 +- .../java/com/adyen/model/management/Url.java | 33 +- .../java/com/adyen/model/management/User.java | 43 +- .../VippsInfo.java} | 136 +-- .../com/adyen/model/management/Webhook.java | 28 +- .../CALocalAccountIdentification.java | 85 +- .../model/transfers/PartyIdentification2.java | 40 +- .../com/adyen/model/transfers/Transfer.java | 4 +- .../java/com/adyen/BalancePlatformTest.java | 12 +- .../balancePlatform/PaymentInstrument.json | 22 +- 82 files changed, 10909 insertions(+), 877 deletions(-) create mode 100644 src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java rename src/main/java/com/adyen/model/balanceplatform/{VerificationErrorRecursive.java => AdditionalBankIdentification.java} (53%) create mode 100644 src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/StringMatch.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java delete mode 100644 src/main/java/com/adyen/model/balanceplatform/VerificationError.java create mode 100644 src/main/java/com/adyen/model/management/PayAtTable.java rename src/main/java/com/adyen/model/{balanceplatform/BankAccount.java => management/Payment.java} (54%) rename src/main/java/com/adyen/model/{balanceplatform/RemediatingAction.java => management/VippsInfo.java} (51%) diff --git a/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java new file mode 100644 index 000000000..e5f9fdf06 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java @@ -0,0 +1,332 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * AULocalAccountIdentification + */ + +public class AULocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_BSB_CODE = "bsbCode"; + @SerializedName(SERIALIZED_NAME_BSB_CODE) + private String bsbCode; + + /** + * **auLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + AULOCAL("auLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.AULOCAL; + + public AULocalAccountIdentification() { + } + + public AULocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The bank account number, without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The bank account number, without separators or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public AULocalAccountIdentification bsbCode(String bsbCode) { + + this.bsbCode = bsbCode; + return this; + } + + /** + * The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace. + * @return bsbCode + **/ + @ApiModelProperty(required = true, value = "The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace.") + + public String getBsbCode() { + return bsbCode; + } + + + public void setBsbCode(String bsbCode) { + this.bsbCode = bsbCode; + } + + + public AULocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **auLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**auLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AULocalAccountIdentification auLocalAccountIdentification = (AULocalAccountIdentification) o; + return Objects.equals(this.accountNumber, auLocalAccountIdentification.accountNumber) && + Objects.equals(this.bsbCode, auLocalAccountIdentification.bsbCode) && + Objects.equals(this.type, auLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, bsbCode, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AULocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" bsbCode: ").append(toIndentedString(bsbCode)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("bsbCode"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("bsbCode"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AULocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AULocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AULocalAccountIdentification is not found in the empty JSON string", AULocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AULocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AULocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AULocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // validate the optional field bsbCode + if (jsonObj.get("bsbCode") != null && !jsonObj.get("bsbCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bsbCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bsbCode").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AULocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AULocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AULocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AULocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AULocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AULocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of AULocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to AULocalAccountIdentification + */ + public static AULocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AULocalAccountIdentification.class); + } + + /** + * Convert an instance of AULocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java index b9b7eee75..99f10ad6f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java @@ -16,6 +16,7 @@ import java.util.Arrays; import com.adyen.model.balanceplatform.AccountHolderCapability; import com.adyen.model.balanceplatform.ContactDetails; +import com.adyen.model.balanceplatform.VerificationDeadline; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -24,6 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -86,7 +88,7 @@ public class AccountHolder { private String reference; /** - * The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **inactive**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone. + * The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone. */ @JsonAdapter(StatusEnum.Adapter.class) public enum StatusEnum { @@ -144,15 +146,21 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_TIME_ZONE) private String timeZone; + public static final String SERIALIZED_NAME_VERIFICATION_DEADLINES = "verificationDeadlines"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_DEADLINES) + private List verificationDeadlines = null; + public AccountHolder() { } public AccountHolder( - String id + String id, + List verificationDeadlines ) { this(); this.id = id; + this.verificationDeadlines = verificationDeadlines; } public AccountHolder balancePlatform(String balancePlatform) { @@ -271,10 +279,10 @@ public AccountHolder legalEntityId(String legalEntityId) { } /** - * The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. + * The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. * @return legalEntityId **/ - @ApiModelProperty(required = true, value = "The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder.") + @ApiModelProperty(required = true, value = "The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder.") public String getLegalEntityId() { return legalEntityId; @@ -337,10 +345,10 @@ public AccountHolder status(StatusEnum status) { } /** - * The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **inactive**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone. + * The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone. * @return status **/ - @ApiModelProperty(value = "The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **inactive**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone.") + @ApiModelProperty(value = "The status of the account holder. Possible values: * **active**: The account holder is active. This is the default status when creating an account holder. * **inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **closed**: The account holder is permanently deactivated by you. This action cannot be undone.") public StatusEnum getStatus() { return status; @@ -359,10 +367,10 @@ public AccountHolder timeZone(String timeZone) { } /** - * The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. If not set, the time zone of the balance account will be used. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * @return timeZone **/ - @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. If not set, the time zone of the balance account will be used. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") + @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") public String getTimeZone() { return timeZone; @@ -374,6 +382,19 @@ public void setTimeZone(String timeZone) { } + /** + * List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved. + * @return verificationDeadlines + **/ + @ApiModelProperty(value = "List of verification deadlines and the capabilities that will be disallowed if verification errors are not resolved.") + + public List getVerificationDeadlines() { + return verificationDeadlines; + } + + + + @Override public boolean equals(Object o) { @@ -393,12 +414,13 @@ public boolean equals(Object o) { Objects.equals(this.primaryBalanceAccount, accountHolder.primaryBalanceAccount) && Objects.equals(this.reference, accountHolder.reference) && Objects.equals(this.status, accountHolder.status) && - Objects.equals(this.timeZone, accountHolder.timeZone); + Objects.equals(this.timeZone, accountHolder.timeZone) && + Objects.equals(this.verificationDeadlines, accountHolder.verificationDeadlines); } @Override public int hashCode() { - return Objects.hash(balancePlatform, capabilities, contactDetails, description, id, legalEntityId, primaryBalanceAccount, reference, status, timeZone); + return Objects.hash(balancePlatform, capabilities, contactDetails, description, id, legalEntityId, primaryBalanceAccount, reference, status, timeZone, verificationDeadlines); } @Override @@ -415,6 +437,7 @@ public String toString() { sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" verificationDeadlines: ").append(toIndentedString(verificationDeadlines)).append("\n"); sb.append("}"); return sb.toString(); } @@ -447,6 +470,7 @@ private String toIndentedString(Object o) { openapiFields.add("reference"); openapiFields.add("status"); openapiFields.add("timeZone"); + openapiFields.add("verificationDeadlines"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -522,6 +546,18 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("timeZone") != null && !jsonObj.get("timeZone").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `timeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZone").toString())); } + JsonArray jsonArrayverificationDeadlines = jsonObj.getAsJsonArray("verificationDeadlines"); + if (jsonArrayverificationDeadlines != null) { + // ensure the json data is an array + if (!jsonObj.get("verificationDeadlines").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `verificationDeadlines` to be an array in the JSON string but got `%s`", jsonObj.get("verificationDeadlines").toString())); + } + + // validate the optional field `verificationDeadlines` (array) + for (int i = 0; i < jsonArrayverificationDeadlines.size(); i++) { + VerificationDeadline.validateJsonObject(jsonArrayverificationDeadlines.get(i).getAsJsonObject()); + }; + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java index 937163870..e15c34796 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.adyen.model.balanceplatform.AccountSupportingEntityCapability; import com.adyen.model.balanceplatform.JSONObject; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -185,6 +186,10 @@ public RequestedLevelEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_REQUESTED_SETTINGS) private JSONObject requestedSettings; + public static final String SERIALIZED_NAME_TRANSFER_INSTRUMENTS = "transferInstruments"; + @SerializedName(SERIALIZED_NAME_TRANSFER_INSTRUMENTS) + private List transferInstruments = null; + /** * The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. */ @@ -406,6 +411,36 @@ public void setRequestedSettings(JSONObject requestedSettings) { } + public AccountHolderCapability transferInstruments(List transferInstruments) { + + this.transferInstruments = transferInstruments; + return this; + } + + public AccountHolderCapability addTransferInstrumentsItem(AccountSupportingEntityCapability transferInstrumentsItem) { + if (this.transferInstruments == null) { + this.transferInstruments = new ArrayList<>(); + } + this.transferInstruments.add(transferInstrumentsItem); + return this; + } + + /** + * Contains the status of the transfer instruments associated with this capability. + * @return transferInstruments + **/ + @ApiModelProperty(value = "Contains the status of the transfer instruments associated with this capability. ") + + public List getTransferInstruments() { + return transferInstruments; + } + + + public void setTransferInstruments(List transferInstruments) { + this.transferInstruments = transferInstruments; + } + + /** * The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. * @return verificationStatus @@ -437,12 +472,13 @@ public boolean equals(Object o) { Objects.equals(this.requested, accountHolderCapability.requested) && Objects.equals(this.requestedLevel, accountHolderCapability.requestedLevel) && Objects.equals(this.requestedSettings, accountHolderCapability.requestedSettings) && + Objects.equals(this.transferInstruments, accountHolderCapability.transferInstruments) && Objects.equals(this.verificationStatus, accountHolderCapability.verificationStatus); } @Override public int hashCode() { - return Objects.hash(allowed, allowedLevel, allowedSettings, enabled, problems, requested, requestedLevel, requestedSettings, verificationStatus); + return Objects.hash(allowed, allowedLevel, allowedSettings, enabled, problems, requested, requestedLevel, requestedSettings, transferInstruments, verificationStatus); } @Override @@ -457,6 +493,7 @@ public String toString() { sb.append(" requested: ").append(toIndentedString(requested)).append("\n"); sb.append(" requestedLevel: ").append(toIndentedString(requestedLevel)).append("\n"); sb.append(" requestedSettings: ").append(toIndentedString(requestedSettings)).append("\n"); + sb.append(" transferInstruments: ").append(toIndentedString(transferInstruments)).append("\n"); sb.append(" verificationStatus: ").append(toIndentedString(verificationStatus)).append("\n"); sb.append("}"); return sb.toString(); @@ -488,6 +525,7 @@ private String toIndentedString(Object o) { openapiFields.add("requested"); openapiFields.add("requestedLevel"); openapiFields.add("requestedSettings"); + openapiFields.add("transferInstruments"); openapiFields.add("verificationStatus"); // a set of required properties/fields (JSON key names) @@ -542,6 +580,18 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.getAsJsonObject("requestedSettings") != null) { JSONObject.validateJsonObject(jsonObj.getAsJsonObject("requestedSettings")); } + JsonArray jsonArraytransferInstruments = jsonObj.getAsJsonArray("transferInstruments"); + if (jsonArraytransferInstruments != null) { + // ensure the json data is an array + if (!jsonObj.get("transferInstruments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transferInstruments` to be an array in the JSON string but got `%s`", jsonObj.get("transferInstruments").toString())); + } + + // validate the optional field `transferInstruments` (array) + for (int i = 0; i < jsonArraytransferInstruments.size(); i++) { + AccountSupportingEntityCapability.validateJsonObject(jsonArraytransferInstruments.get(i).getAsJsonObject()); + }; + } // ensure the field verificationStatus can be parsed to an enum value if (jsonObj.get("verificationStatus") != null) { if(!jsonObj.get("verificationStatus").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java index 7c7d29761..ecf156fe6 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java @@ -187,10 +187,10 @@ public AccountHolderInfo legalEntityId(String legalEntityId) { } /** - * The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. + * The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. * @return legalEntityId **/ - @ApiModelProperty(required = true, value = "The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder.") + @ApiModelProperty(required = true, value = "The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder.") public String getLegalEntityId() { return legalEntityId; @@ -231,10 +231,10 @@ public AccountHolderInfo timeZone(String timeZone) { } /** - * The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. If not set, the time zone of the balance account will be used. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * @return timeZone **/ - @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. If not set, the time zone of the balance account will be used. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") + @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") public String getTimeZone() { return timeZone; diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java b/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java new file mode 100644 index 000000000..7de73d709 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java @@ -0,0 +1,534 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * AccountSupportingEntityCapability + */ + +public class AccountSupportingEntityCapability { + public static final String SERIALIZED_NAME_ALLOWED = "allowed"; + @SerializedName(SERIALIZED_NAME_ALLOWED) + private Boolean allowed; + + /** + * The capability level that is allowed for the account holder. Possible values: **notApplicable**, **low**, **medium**, **high**. + */ + @JsonAdapter(AllowedLevelEnum.Adapter.class) + public enum AllowedLevelEnum { + HIGH("high"), + + LOW("low"), + + MEDIUM("medium"), + + NOTAPPLICABLE("notApplicable"); + + private String value; + + AllowedLevelEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AllowedLevelEnum fromValue(String value) { + for (AllowedLevelEnum b : AllowedLevelEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AllowedLevelEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AllowedLevelEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AllowedLevelEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ALLOWED_LEVEL = "allowedLevel"; + @SerializedName(SERIALIZED_NAME_ALLOWED_LEVEL) + private AllowedLevelEnum allowedLevel; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_REQUESTED = "requested"; + @SerializedName(SERIALIZED_NAME_REQUESTED) + private Boolean requested; + + /** + * The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. + */ + @JsonAdapter(RequestedLevelEnum.Adapter.class) + public enum RequestedLevelEnum { + HIGH("high"), + + LOW("low"), + + MEDIUM("medium"), + + NOTAPPLICABLE("notApplicable"); + + private String value; + + RequestedLevelEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RequestedLevelEnum fromValue(String value) { + for (RequestedLevelEnum b : RequestedLevelEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RequestedLevelEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RequestedLevelEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RequestedLevelEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_REQUESTED_LEVEL = "requestedLevel"; + @SerializedName(SERIALIZED_NAME_REQUESTED_LEVEL) + private RequestedLevelEnum requestedLevel; + + /** + * The status of the verification checks for the supporting entity capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + */ + @JsonAdapter(VerificationStatusEnum.Adapter.class) + public enum VerificationStatusEnum { + INVALID("invalid"), + + PENDING("pending"), + + REJECTED("rejected"), + + VALID("valid"); + + private String value; + + VerificationStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static VerificationStatusEnum fromValue(String value) { + for (VerificationStatusEnum b : VerificationStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final VerificationStatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public VerificationStatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return VerificationStatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_VERIFICATION_STATUS = "verificationStatus"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_STATUS) + private VerificationStatusEnum verificationStatus; + + public AccountSupportingEntityCapability() { + } + + + public AccountSupportingEntityCapability( + Boolean allowed, + AllowedLevelEnum allowedLevel, + String id, + VerificationStatusEnum verificationStatus + ) { + this(); + this.allowed = allowed; + this.allowedLevel = allowedLevel; + this.id = id; + this.verificationStatus = verificationStatus; + } + + /** + * Indicates whether the supporting entity capability is allowed. Adyen sets this to **true** if the verification is successful and the account holder is permitted to use the capability. + * @return allowed + **/ + @ApiModelProperty(value = "Indicates whether the supporting entity capability is allowed. Adyen sets this to **true** if the verification is successful and the account holder is permitted to use the capability.") + + public Boolean getAllowed() { + return allowed; + } + + + + + /** + * The capability level that is allowed for the account holder. Possible values: **notApplicable**, **low**, **medium**, **high**. + * @return allowedLevel + **/ + @ApiModelProperty(value = "The capability level that is allowed for the account holder. Possible values: **notApplicable**, **low**, **medium**, **high**.") + + public AllowedLevelEnum getAllowedLevel() { + return allowedLevel; + } + + + + + public AccountSupportingEntityCapability enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * Indicates whether the capability is enabled. If **false**, the capability is temporarily disabled for the account holder. + * @return enabled + **/ + @ApiModelProperty(value = "Indicates whether the capability is enabled. If **false**, the capability is temporarily disabled for the account holder.") + + public Boolean getEnabled() { + return enabled; + } + + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + + /** + * The ID of the supporting entity. + * @return id + **/ + @ApiModelProperty(value = "The ID of the supporting entity.") + + public String getId() { + return id; + } + + + + + public AccountSupportingEntityCapability requested(Boolean requested) { + + this.requested = requested; + return this; + } + + /** + * Indicates whether the capability is requested. To check whether the account holder is permitted to use the capability, refer to the `allowed` field. + * @return requested + **/ + @ApiModelProperty(value = "Indicates whether the capability is requested. To check whether the account holder is permitted to use the capability, refer to the `allowed` field.") + + public Boolean getRequested() { + return requested; + } + + + public void setRequested(Boolean requested) { + this.requested = requested; + } + + + public AccountSupportingEntityCapability requestedLevel(RequestedLevelEnum requestedLevel) { + + this.requestedLevel = requestedLevel; + return this; + } + + /** + * The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. + * @return requestedLevel + **/ + @ApiModelProperty(value = "The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**.") + + public RequestedLevelEnum getRequestedLevel() { + return requestedLevel; + } + + + public void setRequestedLevel(RequestedLevelEnum requestedLevel) { + this.requestedLevel = requestedLevel; + } + + + /** + * The status of the verification checks for the supporting entity capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + * @return verificationStatus + **/ + @ApiModelProperty(value = "The status of the verification checks for the supporting entity capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. ") + + public VerificationStatusEnum getVerificationStatus() { + return verificationStatus; + } + + + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountSupportingEntityCapability accountSupportingEntityCapability = (AccountSupportingEntityCapability) o; + return Objects.equals(this.allowed, accountSupportingEntityCapability.allowed) && + Objects.equals(this.allowedLevel, accountSupportingEntityCapability.allowedLevel) && + Objects.equals(this.enabled, accountSupportingEntityCapability.enabled) && + Objects.equals(this.id, accountSupportingEntityCapability.id) && + Objects.equals(this.requested, accountSupportingEntityCapability.requested) && + Objects.equals(this.requestedLevel, accountSupportingEntityCapability.requestedLevel) && + Objects.equals(this.verificationStatus, accountSupportingEntityCapability.verificationStatus); + } + + @Override + public int hashCode() { + return Objects.hash(allowed, allowedLevel, enabled, id, requested, requestedLevel, verificationStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountSupportingEntityCapability {\n"); + sb.append(" allowed: ").append(toIndentedString(allowed)).append("\n"); + sb.append(" allowedLevel: ").append(toIndentedString(allowedLevel)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" requested: ").append(toIndentedString(requested)).append("\n"); + sb.append(" requestedLevel: ").append(toIndentedString(requestedLevel)).append("\n"); + sb.append(" verificationStatus: ").append(toIndentedString(verificationStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("allowed"); + openapiFields.add("allowedLevel"); + openapiFields.add("enabled"); + openapiFields.add("id"); + openapiFields.add("requested"); + openapiFields.add("requestedLevel"); + openapiFields.add("verificationStatus"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AccountSupportingEntityCapability + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AccountSupportingEntityCapability.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AccountSupportingEntityCapability is not found in the empty JSON string", AccountSupportingEntityCapability.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AccountSupportingEntityCapability.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AccountSupportingEntityCapability` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the field allowedLevel can be parsed to an enum value + if (jsonObj.get("allowedLevel") != null) { + if(!jsonObj.get("allowedLevel").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `allowedLevel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("allowedLevel").toString())); + } + AllowedLevelEnum.fromValue(jsonObj.get("allowedLevel").getAsString()); + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // ensure the field requestedLevel can be parsed to an enum value + if (jsonObj.get("requestedLevel") != null) { + if(!jsonObj.get("requestedLevel").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestedLevel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestedLevel").toString())); + } + RequestedLevelEnum.fromValue(jsonObj.get("requestedLevel").getAsString()); + } + // ensure the field verificationStatus can be parsed to an enum value + if (jsonObj.get("verificationStatus") != null) { + if(!jsonObj.get("verificationStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verificationStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verificationStatus").toString())); + } + VerificationStatusEnum.fromValue(jsonObj.get("verificationStatus").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountSupportingEntityCapability.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountSupportingEntityCapability' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccountSupportingEntityCapability.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountSupportingEntityCapability value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountSupportingEntityCapability read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccountSupportingEntityCapability given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountSupportingEntityCapability + * @throws IOException if the JSON string is invalid with respect to AccountSupportingEntityCapability + */ + public static AccountSupportingEntityCapability fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountSupportingEntityCapability.class); + } + + /** + * Convert an instance of AccountSupportingEntityCapability to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/VerificationErrorRecursive.java b/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java similarity index 53% rename from src/main/java/com/adyen/model/balanceplatform/VerificationErrorRecursive.java rename to src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java index ba47ca282..d817ed804 100644 --- a/src/main/java/com/adyen/model/balanceplatform/VerificationErrorRecursive.java +++ b/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java @@ -14,7 +14,6 @@ import java.util.Objects; import java.util.Arrays; -import com.adyen.model.balanceplatform.RemediatingAction; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -23,8 +22,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -47,28 +44,22 @@ import com.adyen.model.balanceplatform.JSON; /** - * VerificationErrorRecursive + * AdditionalBankIdentification */ -public class VerificationErrorRecursive { +public class AdditionalBankIdentification { public static final String SERIALIZED_NAME_CODE = "code"; @SerializedName(SERIALIZED_NAME_CODE) private String code; - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - /** - * The type of error. Possible values: **invalidInput**, **dataMissing**. + * The type of additional bank identification, depending on the country. Possible values: * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { - DATAMISSING("dataMissing"), - - INVALIDINPUT("invalidInput"), + GBSORTCODE("gbSortCode"), - PENDINGSTATUS("pendingStatus"); + USROUTINGNUMBER("usRoutingNumber"); private String value; @@ -112,24 +103,20 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_TYPE) private TypeEnum type; - public static final String SERIALIZED_NAME_REMEDIATING_ACTIONS = "remediatingActions"; - @SerializedName(SERIALIZED_NAME_REMEDIATING_ACTIONS) - private List remediatingActions = null; - - public VerificationErrorRecursive() { + public AdditionalBankIdentification() { } - public VerificationErrorRecursive code(String code) { + public AdditionalBankIdentification code(String code) { this.code = code; return this; } /** - * The verification error code. + * The value of the additional bank identification. * @return code **/ - @ApiModelProperty(value = "The verification error code.") + @ApiModelProperty(value = "The value of the additional bank identification.") public String getCode() { return code; @@ -141,39 +128,17 @@ public void setCode(String code) { } - public VerificationErrorRecursive message(String message) { - - this.message = message; - return this; - } - - /** - * A description of the error. - * @return message - **/ - @ApiModelProperty(value = "A description of the error.") - - public String getMessage() { - return message; - } - - - public void setMessage(String message) { - this.message = message; - } - - - public VerificationErrorRecursive type(TypeEnum type) { + public AdditionalBankIdentification type(TypeEnum type) { this.type = type; return this; } /** - * The type of error. Possible values: **invalidInput**, **dataMissing**. + * The type of additional bank identification, depending on the country. Possible values: * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. * @return type **/ - @ApiModelProperty(value = "The type of error. Possible values: **invalidInput**, **dataMissing**.") + @ApiModelProperty(value = "The type of additional bank identification, depending on the country. Possible values: * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces.") public TypeEnum getType() { return type; @@ -185,36 +150,6 @@ public void setType(TypeEnum type) { } - public VerificationErrorRecursive remediatingActions(List remediatingActions) { - - this.remediatingActions = remediatingActions; - return this; - } - - public VerificationErrorRecursive addRemediatingActionsItem(RemediatingAction remediatingActionsItem) { - if (this.remediatingActions == null) { - this.remediatingActions = new ArrayList<>(); - } - this.remediatingActions.add(remediatingActionsItem); - return this; - } - - /** - * Contains the actions that you can take to resolve the verification error. - * @return remediatingActions - **/ - @ApiModelProperty(value = "Contains the actions that you can take to resolve the verification error.") - - public List getRemediatingActions() { - return remediatingActions; - } - - - public void setRemediatingActions(List remediatingActions) { - this.remediatingActions = remediatingActions; - } - - @Override public boolean equals(Object o) { @@ -224,26 +159,22 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - VerificationErrorRecursive verificationErrorRecursive = (VerificationErrorRecursive) o; - return Objects.equals(this.code, verificationErrorRecursive.code) && - Objects.equals(this.message, verificationErrorRecursive.message) && - Objects.equals(this.type, verificationErrorRecursive.type) && - Objects.equals(this.remediatingActions, verificationErrorRecursive.remediatingActions); + AdditionalBankIdentification additionalBankIdentification = (AdditionalBankIdentification) o; + return Objects.equals(this.code, additionalBankIdentification.code) && + Objects.equals(this.type, additionalBankIdentification.type); } @Override public int hashCode() { - return Objects.hash(code, message, type, remediatingActions); + return Objects.hash(code, type); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class VerificationErrorRecursive {\n"); + sb.append("class AdditionalBankIdentification {\n"); sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" remediatingActions: ").append(toIndentedString(remediatingActions)).append("\n"); sb.append("}"); return sb.toString(); } @@ -267,9 +198,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("code"); - openapiFields.add("message"); openapiFields.add("type"); - openapiFields.add("remediatingActions"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -279,32 +208,28 @@ private String toIndentedString(Object o) { * Validates the JSON Object and throws an exception if issues found * * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to VerificationErrorRecursive + * @throws IOException if the JSON Object is invalid with respect to AdditionalBankIdentification */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { - if (VerificationErrorRecursive.openapiRequiredFields.isEmpty()) { + if (AdditionalBankIdentification.openapiRequiredFields.isEmpty()) { return; } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in VerificationErrorRecursive is not found in the empty JSON string", VerificationErrorRecursive.openapiRequiredFields.toString())); + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalBankIdentification is not found in the empty JSON string", AdditionalBankIdentification.openapiRequiredFields.toString())); } } Set> entries = jsonObj.entrySet(); // check to see if the JSON string contains additional fields for (Entry entry : entries) { - if (!VerificationErrorRecursive.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VerificationErrorRecursive` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + if (!AdditionalBankIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalBankIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } // validate the optional field code if (jsonObj.get("code") != null && !jsonObj.get("code").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); } - // validate the optional field message - if (jsonObj.get("message") != null && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } // ensure the field type can be parsed to an enum value if (jsonObj.get("type") != null) { if(!jsonObj.get("type").isJsonPrimitive()) { @@ -312,40 +237,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } TypeEnum.fromValue(jsonObj.get("type").getAsString()); } - JsonArray jsonArrayremediatingActions = jsonObj.getAsJsonArray("remediatingActions"); - if (jsonArrayremediatingActions != null) { - // ensure the json data is an array - if (!jsonObj.get("remediatingActions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `remediatingActions` to be an array in the JSON string but got `%s`", jsonObj.get("remediatingActions").toString())); - } - - // validate the optional field `remediatingActions` (array) - for (int i = 0; i < jsonArrayremediatingActions.size(); i++) { - RemediatingAction.validateJsonObject(jsonArrayremediatingActions.get(i).getAsJsonObject()); - }; - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!VerificationErrorRecursive.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'VerificationErrorRecursive' and its subtypes + if (!AdditionalBankIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalBankIdentification' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(VerificationErrorRecursive.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalBankIdentification.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, VerificationErrorRecursive value) throws IOException { + public void write(JsonWriter out, AdditionalBankIdentification value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public VerificationErrorRecursive read(JsonReader in) throws IOException { + public AdditionalBankIdentification read(JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); return thisAdapter.fromJsonTree(jsonObj); @@ -356,18 +269,18 @@ public VerificationErrorRecursive read(JsonReader in) throws IOException { } /** - * Create an instance of VerificationErrorRecursive given an JSON string + * Create an instance of AdditionalBankIdentification given an JSON string * * @param jsonString JSON string - * @return An instance of VerificationErrorRecursive - * @throws IOException if the JSON string is invalid with respect to VerificationErrorRecursive + * @return An instance of AdditionalBankIdentification + * @throws IOException if the JSON string is invalid with respect to AdditionalBankIdentification */ - public static VerificationErrorRecursive fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, VerificationErrorRecursive.class); + public static AdditionalBankIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalBankIdentification.class); } /** - * Convert an instance of VerificationErrorRecursive to an JSON string + * Convert an instance of AdditionalBankIdentification to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java index 989c55ca6..f150ef31b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java @@ -306,10 +306,10 @@ public BalanceAccount timeZone(String timeZone) { } /** - * The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. If not set, the time zone of the account holder will be used. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * @return timeZone **/ - @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. If not set, the time zone of the account holder will be used. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") + @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") public String getTimeZone() { return timeZone; diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java new file mode 100644 index 000000000..59c564e5c --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java @@ -0,0 +1,469 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * BalanceAccountBase + */ + +public class BalanceAccountBase { + public static final String SERIALIZED_NAME_ACCOUNT_HOLDER_ID = "accountHolderId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_HOLDER_ID) + private String accountHolderId; + + public static final String SERIALIZED_NAME_DEFAULT_CURRENCY_CODE = "defaultCurrencyCode"; + @SerializedName(SERIALIZED_NAME_DEFAULT_CURRENCY_CODE) + private String defaultCurrencyCode; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; + + /** + * The status of the balance account, set to **active** by default. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACTIVE("active"), + + CLOSED("closed"), + + INACTIVE("inactive"), + + SUSPENDED("suspended"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_TIME_ZONE = "timeZone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + private String timeZone; + + public BalanceAccountBase() { + } + + public BalanceAccountBase accountHolderId(String accountHolderId) { + + this.accountHolderId = accountHolderId; + return this; + } + + /** + * The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. + * @return accountHolderId + **/ + @ApiModelProperty(required = true, value = "The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account.") + + public String getAccountHolderId() { + return accountHolderId; + } + + + public void setAccountHolderId(String accountHolderId) { + this.accountHolderId = accountHolderId; + } + + + public BalanceAccountBase defaultCurrencyCode(String defaultCurrencyCode) { + + this.defaultCurrencyCode = defaultCurrencyCode; + return this; + } + + /** + * The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + * @return defaultCurrencyCode + **/ + @ApiModelProperty(value = "The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**.") + + public String getDefaultCurrencyCode() { + return defaultCurrencyCode; + } + + + public void setDefaultCurrencyCode(String defaultCurrencyCode) { + this.defaultCurrencyCode = defaultCurrencyCode; + } + + + public BalanceAccountBase description(String description) { + + this.description = description; + return this; + } + + /** + * A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. + * @return description + **/ + @ApiModelProperty(value = "A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder.") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public BalanceAccountBase id(String id) { + + this.id = id; + return this; + } + + /** + * The unique identifier of the balance account. + * @return id + **/ + @ApiModelProperty(required = true, value = "The unique identifier of the balance account.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public BalanceAccountBase reference(String reference) { + + this.reference = reference; + return this; + } + + /** + * Your reference for the balance account, maximum 150 characters. + * @return reference + **/ + @ApiModelProperty(value = "Your reference for the balance account, maximum 150 characters.") + + public String getReference() { + return reference; + } + + + public void setReference(String reference) { + this.reference = reference; + } + + + public BalanceAccountBase status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the balance account, set to **active** by default. + * @return status + **/ + @ApiModelProperty(value = "The status of the balance account, set to **active** by default. ") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public BalanceAccountBase timeZone(String timeZone) { + + this.timeZone = timeZone; + return this; + } + + /** + * The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * @return timeZone + **/ + @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") + + public String getTimeZone() { + return timeZone; + } + + + public void setTimeZone(String timeZone) { + this.timeZone = timeZone; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BalanceAccountBase balanceAccountBase = (BalanceAccountBase) o; + return Objects.equals(this.accountHolderId, balanceAccountBase.accountHolderId) && + Objects.equals(this.defaultCurrencyCode, balanceAccountBase.defaultCurrencyCode) && + Objects.equals(this.description, balanceAccountBase.description) && + Objects.equals(this.id, balanceAccountBase.id) && + Objects.equals(this.reference, balanceAccountBase.reference) && + Objects.equals(this.status, balanceAccountBase.status) && + Objects.equals(this.timeZone, balanceAccountBase.timeZone); + } + + @Override + public int hashCode() { + return Objects.hash(accountHolderId, defaultCurrencyCode, description, id, reference, status, timeZone); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BalanceAccountBase {\n"); + sb.append(" accountHolderId: ").append(toIndentedString(accountHolderId)).append("\n"); + sb.append(" defaultCurrencyCode: ").append(toIndentedString(defaultCurrencyCode)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountHolderId"); + openapiFields.add("defaultCurrencyCode"); + openapiFields.add("description"); + openapiFields.add("id"); + openapiFields.add("reference"); + openapiFields.add("status"); + openapiFields.add("timeZone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountHolderId"); + openapiRequiredFields.add("id"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BalanceAccountBase + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BalanceAccountBase.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BalanceAccountBase is not found in the empty JSON string", BalanceAccountBase.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BalanceAccountBase.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BalanceAccountBase` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BalanceAccountBase.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountHolderId + if (jsonObj.get("accountHolderId") != null && !jsonObj.get("accountHolderId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountHolderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountHolderId").toString())); + } + // validate the optional field defaultCurrencyCode + if (jsonObj.get("defaultCurrencyCode") != null && !jsonObj.get("defaultCurrencyCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `defaultCurrencyCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("defaultCurrencyCode").toString())); + } + // validate the optional field description + if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + // ensure the field status can be parsed to an enum value + if (jsonObj.get("status") != null) { + if(!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + StatusEnum.fromValue(jsonObj.get("status").getAsString()); + } + // validate the optional field timeZone + if (jsonObj.get("timeZone") != null && !jsonObj.get("timeZone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `timeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BalanceAccountBase.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BalanceAccountBase' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BalanceAccountBase.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BalanceAccountBase value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BalanceAccountBase read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BalanceAccountBase given an JSON string + * + * @param jsonString JSON string + * @return An instance of BalanceAccountBase + * @throws IOException if the JSON string is invalid with respect to BalanceAccountBase + */ + public static BalanceAccountBase fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BalanceAccountBase.class); + } + + /** + * Convert an instance of BalanceAccountBase to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java index beb3d4c64..ecba5a984 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java @@ -166,10 +166,10 @@ public BalanceAccountInfo timeZone(String timeZone) { } /** - * The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. If not set, the time zone of the account holder will be used. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * @return timeZone **/ - @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. If not set, the time zone of the account holder will be used. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") + @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") public String getTimeZone() { return timeZone; diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java index 1619fda54..59372f8b0 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java @@ -243,10 +243,10 @@ public BalanceAccountUpdateRequest timeZone(String timeZone) { } /** - * The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. If not set, the time zone of the account holder will be used. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * @return timeZone **/ - @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. If not set, the time zone of the account holder will be used. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") + @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") public String getTimeZone() { return timeZone; diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java new file mode 100644 index 000000000..aa9de9837 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java @@ -0,0 +1,217 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balanceplatform.BankAccountIdentificationValidationRequestAccountIdentification; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * BankAccountIdentificationValidationRequest + */ + +public class BankAccountIdentificationValidationRequest { + public static final String SERIALIZED_NAME_ACCOUNT_IDENTIFICATION = "accountIdentification"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_IDENTIFICATION) + private BankAccountIdentificationValidationRequestAccountIdentification accountIdentification; + + public BankAccountIdentificationValidationRequest() { + } + + public BankAccountIdentificationValidationRequest accountIdentification(BankAccountIdentificationValidationRequestAccountIdentification accountIdentification) { + + this.accountIdentification = accountIdentification; + return this; + } + + /** + * Get accountIdentification + * @return accountIdentification + **/ + @ApiModelProperty(required = true, value = "") + + public BankAccountIdentificationValidationRequestAccountIdentification getAccountIdentification() { + return accountIdentification; + } + + + public void setAccountIdentification(BankAccountIdentificationValidationRequestAccountIdentification accountIdentification) { + this.accountIdentification = accountIdentification; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BankAccountIdentificationValidationRequest bankAccountIdentificationValidationRequest = (BankAccountIdentificationValidationRequest) o; + return Objects.equals(this.accountIdentification, bankAccountIdentificationValidationRequest.accountIdentification); + } + + @Override + public int hashCode() { + return Objects.hash(accountIdentification); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BankAccountIdentificationValidationRequest {\n"); + sb.append(" accountIdentification: ").append(toIndentedString(accountIdentification)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountIdentification"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountIdentification"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BankAccountIdentificationValidationRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BankAccountIdentificationValidationRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BankAccountIdentificationValidationRequest is not found in the empty JSON string", BankAccountIdentificationValidationRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BankAccountIdentificationValidationRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BankAccountIdentificationValidationRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BankAccountIdentificationValidationRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `accountIdentification` + if (jsonObj.getAsJsonObject("accountIdentification") != null) { + BankAccountIdentificationValidationRequestAccountIdentification.validateJsonObject(jsonObj.getAsJsonObject("accountIdentification")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BankAccountIdentificationValidationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BankAccountIdentificationValidationRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BankAccountIdentificationValidationRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BankAccountIdentificationValidationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BankAccountIdentificationValidationRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BankAccountIdentificationValidationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of BankAccountIdentificationValidationRequest + * @throws IOException if the JSON string is invalid with respect to BankAccountIdentificationValidationRequest + */ + public static BankAccountIdentificationValidationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BankAccountIdentificationValidationRequest.class); + } + + /** + * Convert an instance of BankAccountIdentificationValidationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java new file mode 100644 index 000000000..1050fc9f4 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java @@ -0,0 +1,816 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balanceplatform.AULocalAccountIdentification; +import com.adyen.model.balanceplatform.AdditionalBankIdentification; +import com.adyen.model.balanceplatform.CALocalAccountIdentification; +import com.adyen.model.balanceplatform.CZLocalAccountIdentification; +import com.adyen.model.balanceplatform.HULocalAccountIdentification; +import com.adyen.model.balanceplatform.IbanAccountIdentification; +import com.adyen.model.balanceplatform.NOLocalAccountIdentification; +import com.adyen.model.balanceplatform.NumberAndBicAccountIdentification; +import com.adyen.model.balanceplatform.PLLocalAccountIdentification; +import com.adyen.model.balanceplatform.SELocalAccountIdentification; +import com.adyen.model.balanceplatform.SGLocalAccountIdentification; +import com.adyen.model.balanceplatform.UKLocalAccountIdentification; +import com.adyen.model.balanceplatform.USLocalAccountIdentification; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import com.adyen.model.balanceplatform.JSON; + + +public class BankAccountIdentificationValidationRequestAccountIdentification extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(BankAccountIdentificationValidationRequestAccountIdentification.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BankAccountIdentificationValidationRequestAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BankAccountIdentificationValidationRequestAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterAULocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(AULocalAccountIdentification.class)); + final TypeAdapter adapterCALocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(CALocalAccountIdentification.class)); + final TypeAdapter adapterCZLocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(CZLocalAccountIdentification.class)); + final TypeAdapter adapterHULocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(HULocalAccountIdentification.class)); + final TypeAdapter adapterIbanAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(IbanAccountIdentification.class)); + final TypeAdapter adapterNOLocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(NOLocalAccountIdentification.class)); + final TypeAdapter adapterNumberAndBicAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(NumberAndBicAccountIdentification.class)); + final TypeAdapter adapterPLLocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(PLLocalAccountIdentification.class)); + final TypeAdapter adapterSELocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(SELocalAccountIdentification.class)); + final TypeAdapter adapterSGLocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(SGLocalAccountIdentification.class)); + final TypeAdapter adapterUKLocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(UKLocalAccountIdentification.class)); + final TypeAdapter adapterUSLocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(USLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BankAccountIdentificationValidationRequestAccountIdentification value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `AULocalAccountIdentification` + if (value.getActualInstance() instanceof AULocalAccountIdentification) { + JsonObject obj = adapterAULocalAccountIdentification.toJsonTree((AULocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CALocalAccountIdentification` + if (value.getActualInstance() instanceof CALocalAccountIdentification) { + JsonObject obj = adapterCALocalAccountIdentification.toJsonTree((CALocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CZLocalAccountIdentification` + if (value.getActualInstance() instanceof CZLocalAccountIdentification) { + JsonObject obj = adapterCZLocalAccountIdentification.toJsonTree((CZLocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `HULocalAccountIdentification` + if (value.getActualInstance() instanceof HULocalAccountIdentification) { + JsonObject obj = adapterHULocalAccountIdentification.toJsonTree((HULocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `IbanAccountIdentification` + if (value.getActualInstance() instanceof IbanAccountIdentification) { + JsonObject obj = adapterIbanAccountIdentification.toJsonTree((IbanAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `NOLocalAccountIdentification` + if (value.getActualInstance() instanceof NOLocalAccountIdentification) { + JsonObject obj = adapterNOLocalAccountIdentification.toJsonTree((NOLocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `NumberAndBicAccountIdentification` + if (value.getActualInstance() instanceof NumberAndBicAccountIdentification) { + JsonObject obj = adapterNumberAndBicAccountIdentification.toJsonTree((NumberAndBicAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `PLLocalAccountIdentification` + if (value.getActualInstance() instanceof PLLocalAccountIdentification) { + JsonObject obj = adapterPLLocalAccountIdentification.toJsonTree((PLLocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `SELocalAccountIdentification` + if (value.getActualInstance() instanceof SELocalAccountIdentification) { + JsonObject obj = adapterSELocalAccountIdentification.toJsonTree((SELocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `SGLocalAccountIdentification` + if (value.getActualInstance() instanceof SGLocalAccountIdentification) { + JsonObject obj = adapterSGLocalAccountIdentification.toJsonTree((SGLocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `UKLocalAccountIdentification` + if (value.getActualInstance() instanceof UKLocalAccountIdentification) { + JsonObject obj = adapterUKLocalAccountIdentification.toJsonTree((UKLocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `USLocalAccountIdentification` + if (value.getActualInstance() instanceof USLocalAccountIdentification) { + JsonObject obj = adapterUSLocalAccountIdentification.toJsonTree((USLocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification"); + } + + @Override + public BankAccountIdentificationValidationRequestAccountIdentification read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize AULocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + AULocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterAULocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'AULocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AULocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AULocalAccountIdentification'", e); + } + + // deserialize CALocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + CALocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterCALocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'CALocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CALocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CALocalAccountIdentification'", e); + } + + // deserialize CZLocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + CZLocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterCZLocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'CZLocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CZLocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CZLocalAccountIdentification'", e); + } + + // deserialize HULocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + HULocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterHULocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'HULocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for HULocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'HULocalAccountIdentification'", e); + } + + // deserialize IbanAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + IbanAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterIbanAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'IbanAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IbanAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IbanAccountIdentification'", e); + } + + // deserialize NOLocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + NOLocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterNOLocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'NOLocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for NOLocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'NOLocalAccountIdentification'", e); + } + + // deserialize NumberAndBicAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + NumberAndBicAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterNumberAndBicAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'NumberAndBicAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for NumberAndBicAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'NumberAndBicAccountIdentification'", e); + } + + // deserialize PLLocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + PLLocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterPLLocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'PLLocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for PLLocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'PLLocalAccountIdentification'", e); + } + + // deserialize SELocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + SELocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterSELocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'SELocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SELocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SELocalAccountIdentification'", e); + } + + // deserialize SGLocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + SGLocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterSGLocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'SGLocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SGLocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SGLocalAccountIdentification'", e); + } + + // deserialize UKLocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + UKLocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterUKLocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'UKLocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for UKLocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'UKLocalAccountIdentification'", e); + } + + // deserialize USLocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + USLocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterUSLocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'USLocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for USLocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'USLocalAccountIdentification'", e); + } + + if (match == 1) { + BankAccountIdentificationValidationRequestAccountIdentification ret = new BankAccountIdentificationValidationRequestAccountIdentification(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for BankAccountIdentificationValidationRequestAccountIdentification: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public BankAccountIdentificationValidationRequestAccountIdentification() { + super("oneOf", Boolean.FALSE); + } + + public BankAccountIdentificationValidationRequestAccountIdentification(AULocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountIdentificationValidationRequestAccountIdentification(CALocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountIdentificationValidationRequestAccountIdentification(CZLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountIdentificationValidationRequestAccountIdentification(HULocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountIdentificationValidationRequestAccountIdentification(IbanAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountIdentificationValidationRequestAccountIdentification(NOLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountIdentificationValidationRequestAccountIdentification(NumberAndBicAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountIdentificationValidationRequestAccountIdentification(PLLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountIdentificationValidationRequestAccountIdentification(SELocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountIdentificationValidationRequestAccountIdentification(SGLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountIdentificationValidationRequestAccountIdentification(UKLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountIdentificationValidationRequestAccountIdentification(USLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AULocalAccountIdentification", new GenericType() { + }); + schemas.put("CALocalAccountIdentification", new GenericType() { + }); + schemas.put("CZLocalAccountIdentification", new GenericType() { + }); + schemas.put("HULocalAccountIdentification", new GenericType() { + }); + schemas.put("IbanAccountIdentification", new GenericType() { + }); + schemas.put("NOLocalAccountIdentification", new GenericType() { + }); + schemas.put("NumberAndBicAccountIdentification", new GenericType() { + }); + schemas.put("PLLocalAccountIdentification", new GenericType() { + }); + schemas.put("SELocalAccountIdentification", new GenericType() { + }); + schemas.put("SGLocalAccountIdentification", new GenericType() { + }); + schemas.put("UKLocalAccountIdentification", new GenericType() { + }); + schemas.put("USLocalAccountIdentification", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return BankAccountIdentificationValidationRequestAccountIdentification.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AULocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CALocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CZLocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof HULocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof IbanAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof NOLocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof NumberAndBicAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof PLLocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SELocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SGLocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof UKLocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof USLocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification"); + } + + /** + * Get the actual instance, which can be the following: + * AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification + * + * @return The actual instance (AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AULocalAccountIdentification`. If the actual instance is not `AULocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AULocalAccountIdentification` + * @throws ClassCastException if the instance is not `AULocalAccountIdentification` + */ + public AULocalAccountIdentification getAULocalAccountIdentification() throws ClassCastException { + return (AULocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `CALocalAccountIdentification`. If the actual instance is not `CALocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CALocalAccountIdentification` + * @throws ClassCastException if the instance is not `CALocalAccountIdentification` + */ + public CALocalAccountIdentification getCALocalAccountIdentification() throws ClassCastException { + return (CALocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `CZLocalAccountIdentification`. If the actual instance is not `CZLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CZLocalAccountIdentification` + * @throws ClassCastException if the instance is not `CZLocalAccountIdentification` + */ + public CZLocalAccountIdentification getCZLocalAccountIdentification() throws ClassCastException { + return (CZLocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `HULocalAccountIdentification`. If the actual instance is not `HULocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `HULocalAccountIdentification` + * @throws ClassCastException if the instance is not `HULocalAccountIdentification` + */ + public HULocalAccountIdentification getHULocalAccountIdentification() throws ClassCastException { + return (HULocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `IbanAccountIdentification`. If the actual instance is not `IbanAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IbanAccountIdentification` + * @throws ClassCastException if the instance is not `IbanAccountIdentification` + */ + public IbanAccountIdentification getIbanAccountIdentification() throws ClassCastException { + return (IbanAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `NOLocalAccountIdentification`. If the actual instance is not `NOLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `NOLocalAccountIdentification` + * @throws ClassCastException if the instance is not `NOLocalAccountIdentification` + */ + public NOLocalAccountIdentification getNOLocalAccountIdentification() throws ClassCastException { + return (NOLocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `NumberAndBicAccountIdentification`. If the actual instance is not `NumberAndBicAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `NumberAndBicAccountIdentification` + * @throws ClassCastException if the instance is not `NumberAndBicAccountIdentification` + */ + public NumberAndBicAccountIdentification getNumberAndBicAccountIdentification() throws ClassCastException { + return (NumberAndBicAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `PLLocalAccountIdentification`. If the actual instance is not `PLLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `PLLocalAccountIdentification` + * @throws ClassCastException if the instance is not `PLLocalAccountIdentification` + */ + public PLLocalAccountIdentification getPLLocalAccountIdentification() throws ClassCastException { + return (PLLocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `SELocalAccountIdentification`. If the actual instance is not `SELocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SELocalAccountIdentification` + * @throws ClassCastException if the instance is not `SELocalAccountIdentification` + */ + public SELocalAccountIdentification getSELocalAccountIdentification() throws ClassCastException { + return (SELocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `SGLocalAccountIdentification`. If the actual instance is not `SGLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SGLocalAccountIdentification` + * @throws ClassCastException if the instance is not `SGLocalAccountIdentification` + */ + public SGLocalAccountIdentification getSGLocalAccountIdentification() throws ClassCastException { + return (SGLocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `UKLocalAccountIdentification`. If the actual instance is not `UKLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UKLocalAccountIdentification` + * @throws ClassCastException if the instance is not `UKLocalAccountIdentification` + */ + public UKLocalAccountIdentification getUKLocalAccountIdentification() throws ClassCastException { + return (UKLocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `USLocalAccountIdentification`. If the actual instance is not `USLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `USLocalAccountIdentification` + * @throws ClassCastException if the instance is not `USLocalAccountIdentification` + */ + public USLocalAccountIdentification getUSLocalAccountIdentification() throws ClassCastException { + return (USLocalAccountIdentification)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BankAccountIdentificationValidationRequestAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with AULocalAccountIdentification + try { + AULocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AULocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CALocalAccountIdentification + try { + CALocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CALocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CZLocalAccountIdentification + try { + CZLocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CZLocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with HULocalAccountIdentification + try { + HULocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for HULocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with IbanAccountIdentification + try { + IbanAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IbanAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with NOLocalAccountIdentification + try { + NOLocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for NOLocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with NumberAndBicAccountIdentification + try { + NumberAndBicAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for NumberAndBicAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with PLLocalAccountIdentification + try { + PLLocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for PLLocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with SELocalAccountIdentification + try { + SELocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SELocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with SGLocalAccountIdentification + try { + SGLocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SGLocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with UKLocalAccountIdentification + try { + UKLocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for UKLocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with USLocalAccountIdentification + try { + USLocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for USLocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for BankAccountIdentificationValidationRequestAccountIdentification with oneOf schemas: AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of BankAccountIdentificationValidationRequestAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of BankAccountIdentificationValidationRequestAccountIdentification + * @throws IOException if the JSON string is invalid with respect to BankAccountIdentificationValidationRequestAccountIdentification + */ + public static BankAccountIdentificationValidationRequestAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BankAccountIdentificationValidationRequestAccountIdentification.class); + } + + /** + * Convert an instance of BankAccountIdentificationValidationRequestAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java new file mode 100644 index 000000000..29b7d8e76 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java @@ -0,0 +1,449 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * CALocalAccountIdentification + */ + +public class CALocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + /** + * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + */ + @JsonAdapter(AccountTypeEnum.Adapter.class) + public enum AccountTypeEnum { + CHECKING("checking"), + + SAVINGS("savings"); + + private String value; + + AccountTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AccountTypeEnum fromValue(String value) { + for (AccountTypeEnum b : AccountTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AccountTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AccountTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AccountTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ACCOUNT_TYPE = "accountType"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_TYPE) + private AccountTypeEnum accountType = AccountTypeEnum.CHECKING; + + public static final String SERIALIZED_NAME_INSTITUTION_NUMBER = "institutionNumber"; + @SerializedName(SERIALIZED_NAME_INSTITUTION_NUMBER) + private String institutionNumber; + + public static final String SERIALIZED_NAME_TRANSIT_NUMBER = "transitNumber"; + @SerializedName(SERIALIZED_NAME_TRANSIT_NUMBER) + private String transitNumber; + + /** + * **caLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CALOCAL("caLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.CALOCAL; + + public CALocalAccountIdentification() { + } + + public CALocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 5- to 12-digit bank account number, without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 5- to 12-digit bank account number, without separators or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public CALocalAccountIdentification accountType(AccountTypeEnum accountType) { + + this.accountType = accountType; + return this; + } + + /** + * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * @return accountType + **/ + @ApiModelProperty(value = "The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**.") + + public AccountTypeEnum getAccountType() { + return accountType; + } + + + public void setAccountType(AccountTypeEnum accountType) { + this.accountType = accountType; + } + + + public CALocalAccountIdentification institutionNumber(String institutionNumber) { + + this.institutionNumber = institutionNumber; + return this; + } + + /** + * The 3-digit institution number, without separators or whitespace. + * @return institutionNumber + **/ + @ApiModelProperty(required = true, value = "The 3-digit institution number, without separators or whitespace.") + + public String getInstitutionNumber() { + return institutionNumber; + } + + + public void setInstitutionNumber(String institutionNumber) { + this.institutionNumber = institutionNumber; + } + + + public CALocalAccountIdentification transitNumber(String transitNumber) { + + this.transitNumber = transitNumber; + return this; + } + + /** + * The 5-digit transit number, without separators or whitespace. + * @return transitNumber + **/ + @ApiModelProperty(required = true, value = "The 5-digit transit number, without separators or whitespace.") + + public String getTransitNumber() { + return transitNumber; + } + + + public void setTransitNumber(String transitNumber) { + this.transitNumber = transitNumber; + } + + + public CALocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **caLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**caLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CALocalAccountIdentification caLocalAccountIdentification = (CALocalAccountIdentification) o; + return Objects.equals(this.accountNumber, caLocalAccountIdentification.accountNumber) && + Objects.equals(this.accountType, caLocalAccountIdentification.accountType) && + Objects.equals(this.institutionNumber, caLocalAccountIdentification.institutionNumber) && + Objects.equals(this.transitNumber, caLocalAccountIdentification.transitNumber) && + Objects.equals(this.type, caLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, accountType, institutionNumber, transitNumber, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CALocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); + sb.append(" institutionNumber: ").append(toIndentedString(institutionNumber)).append("\n"); + sb.append(" transitNumber: ").append(toIndentedString(transitNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("accountType"); + openapiFields.add("institutionNumber"); + openapiFields.add("transitNumber"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("institutionNumber"); + openapiRequiredFields.add("transitNumber"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CALocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CALocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CALocalAccountIdentification is not found in the empty JSON string", CALocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CALocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CALocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CALocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // ensure the field accountType can be parsed to an enum value + if (jsonObj.get("accountType") != null) { + if(!jsonObj.get("accountType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountType").toString())); + } + AccountTypeEnum.fromValue(jsonObj.get("accountType").getAsString()); + } + // validate the optional field institutionNumber + if (jsonObj.get("institutionNumber") != null && !jsonObj.get("institutionNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `institutionNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("institutionNumber").toString())); + } + // validate the optional field transitNumber + if (jsonObj.get("transitNumber") != null && !jsonObj.get("transitNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transitNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transitNumber").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CALocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CALocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CALocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CALocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CALocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CALocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of CALocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to CALocalAccountIdentification + */ + public static CALocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CALocalAccountIdentification.class); + } + + /** + * Convert an instance of CALocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java new file mode 100644 index 000000000..c8c28d5c3 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java @@ -0,0 +1,332 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * CZLocalAccountIdentification + */ + +public class CZLocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_BANK_CODE = "bankCode"; + @SerializedName(SERIALIZED_NAME_BANK_CODE) + private String bankCode; + + /** + * **czLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CZLOCAL("czLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.CZLOCAL; + + public CZLocalAccountIdentification() { + } + + public CZLocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 2- to 16-digit bank account number (Číslo účtu) in the following format: - The optional prefix (předčíslí). - The required second part (základní část) which must be at least two non-zero digits. Examples: - **19-123457** (with prefix) - **123457** (without prefix) - **000019-0000123457** (with prefix, normalized) - **000000-0000123457** (without prefix, normalized) + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 2- to 16-digit bank account number (Číslo účtu) in the following format: - The optional prefix (předčíslí). - The required second part (základní část) which must be at least two non-zero digits. Examples: - **19-123457** (with prefix) - **123457** (without prefix) - **000019-0000123457** (with prefix, normalized) - **000000-0000123457** (without prefix, normalized)") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public CZLocalAccountIdentification bankCode(String bankCode) { + + this.bankCode = bankCode; + return this; + } + + /** + * The 4-digit bank code (Kód banky), without separators or whitespace. + * @return bankCode + **/ + @ApiModelProperty(required = true, value = "The 4-digit bank code (Kód banky), without separators or whitespace.") + + public String getBankCode() { + return bankCode; + } + + + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + + public CZLocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **czLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**czLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CZLocalAccountIdentification czLocalAccountIdentification = (CZLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, czLocalAccountIdentification.accountNumber) && + Objects.equals(this.bankCode, czLocalAccountIdentification.bankCode) && + Objects.equals(this.type, czLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, bankCode, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CZLocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" bankCode: ").append(toIndentedString(bankCode)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("bankCode"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("bankCode"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CZLocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CZLocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CZLocalAccountIdentification is not found in the empty JSON string", CZLocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CZLocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CZLocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CZLocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // validate the optional field bankCode + if (jsonObj.get("bankCode") != null && !jsonObj.get("bankCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bankCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankCode").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CZLocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CZLocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CZLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CZLocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CZLocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CZLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of CZLocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to CZLocalAccountIdentification + */ + public static CZLocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CZLocalAccountIdentification.class); + } + + /** + * Convert an instance of CZLocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/Card.java b/src/main/java/com/adyen/model/balanceplatform/Card.java index 7bc0e897b..452e72c66 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Card.java +++ b/src/main/java/com/adyen/model/balanceplatform/Card.java @@ -211,10 +211,10 @@ public Card brand(String brand) { } /** - * The brand of the payment instrument. Possible values: **visa**, **mc**. + * The brand of the physical or the virtual card. Possible values: **visa**, **mc**. * @return brand **/ - @ApiModelProperty(required = true, value = "The brand of the payment instrument. Possible values: **visa**, **mc**.") + @ApiModelProperty(required = true, value = "The brand of the physical or the virtual card. Possible values: **visa**, **mc**.") public String getBrand() { return brand; @@ -233,10 +233,10 @@ public Card brandVariant(String brandVariant) { } /** - * The brand variant of the payment instrument. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**. + * The brand variant of the physical or the virtual card. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**. * @return brandVariant **/ - @ApiModelProperty(required = true, value = "The brand variant of the payment instrument. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**.") + @ApiModelProperty(required = true, value = "The brand variant of the physical or the virtual card. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**.") public String getBrandVariant() { return brandVariant; diff --git a/src/main/java/com/adyen/model/balanceplatform/CardInfo.java b/src/main/java/com/adyen/model/balanceplatform/CardInfo.java index 4a8177dba..6d139ab2a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardInfo.java @@ -160,10 +160,10 @@ public CardInfo brand(String brand) { } /** - * The brand of the payment instrument. Possible values: **visa**, **mc**. + * The brand of the physical or the virtual card. Possible values: **visa**, **mc**. * @return brand **/ - @ApiModelProperty(required = true, value = "The brand of the payment instrument. Possible values: **visa**, **mc**.") + @ApiModelProperty(required = true, value = "The brand of the physical or the virtual card. Possible values: **visa**, **mc**.") public String getBrand() { return brand; @@ -182,10 +182,10 @@ public CardInfo brandVariant(String brandVariant) { } /** - * The brand variant of the payment instrument. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**. + * The brand variant of the physical or the virtual card. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**. * @return brandVariant **/ - @ApiModelProperty(required = true, value = "The brand variant of the payment instrument. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**.") + @ApiModelProperty(required = true, value = "The brand variant of the physical or the virtual card. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**.") public String getBrandVariant() { return brandVariant; diff --git a/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java b/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java new file mode 100644 index 000000000..facb055c1 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java @@ -0,0 +1,316 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * DayOfWeekRestriction + */ + +public class DayOfWeekRestriction { + public static final String SERIALIZED_NAME_OPERATION = "operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + private String operation; + + /** + * Gets or Sets value + */ + @JsonAdapter(ValueEnum.Adapter.class) + public enum ValueEnum { + FRIDAY("friday"), + + MONDAY("monday"), + + SATURDAY("saturday"), + + SUNDAY("sunday"), + + THURSDAY("thursday"), + + TUESDAY("tuesday"), + + WEDNESDAY("wednesday"); + + private String value; + + ValueEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ValueEnum fromValue(String value) { + for (ValueEnum b : ValueEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ValueEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ValueEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ValueEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private List value = null; + + public DayOfWeekRestriction() { + } + + public DayOfWeekRestriction operation(String operation) { + + this.operation = operation; + return this; + } + + /** + * Defines how the condition must be evaluated. + * @return operation + **/ + @ApiModelProperty(required = true, value = "Defines how the condition must be evaluated.") + + public String getOperation() { + return operation; + } + + + public void setOperation(String operation) { + this.operation = operation; + } + + + public DayOfWeekRestriction value(List value) { + + this.value = value; + return this; + } + + public DayOfWeekRestriction addValueItem(ValueEnum valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * List of days of the week. Possible values: **monday**, **tuesday**, **wednesday**, **thursday**, **friday**, **saturday**, **sunday**. + * @return value + **/ + @ApiModelProperty(value = "List of days of the week. Possible values: **monday**, **tuesday**, **wednesday**, **thursday**, **friday**, **saturday**, **sunday**. ") + + public List getValue() { + return value; + } + + + public void setValue(List value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DayOfWeekRestriction dayOfWeekRestriction = (DayOfWeekRestriction) o; + return Objects.equals(this.operation, dayOfWeekRestriction.operation) && + Objects.equals(this.value, dayOfWeekRestriction.value); + } + + @Override + public int hashCode() { + return Objects.hash(operation, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DayOfWeekRestriction {\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("operation"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("operation"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DayOfWeekRestriction + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DayOfWeekRestriction.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DayOfWeekRestriction is not found in the empty JSON string", DayOfWeekRestriction.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DayOfWeekRestriction.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DayOfWeekRestriction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DayOfWeekRestriction.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field operation + if (jsonObj.get("operation") != null && !jsonObj.get("operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); + } + // ensure the json data is an array + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DayOfWeekRestriction.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DayOfWeekRestriction' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DayOfWeekRestriction.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DayOfWeekRestriction value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DayOfWeekRestriction read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DayOfWeekRestriction given an JSON string + * + * @param jsonString JSON string + * @return An instance of DayOfWeekRestriction + * @throws IOException if the JSON string is invalid with respect to DayOfWeekRestriction + */ + public static DayOfWeekRestriction fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DayOfWeekRestriction.class); + } + + /** + * Convert an instance of DayOfWeekRestriction to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java new file mode 100644 index 000000000..b49471c82 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java @@ -0,0 +1,298 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * HULocalAccountIdentification + */ + +public class HULocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + /** + * **huLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + HULOCAL("huLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.HULOCAL; + + public HULocalAccountIdentification() { + } + + public HULocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 24-digit bank account number, without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 24-digit bank account number, without separators or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public HULocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **huLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**huLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HULocalAccountIdentification huLocalAccountIdentification = (HULocalAccountIdentification) o; + return Objects.equals(this.accountNumber, huLocalAccountIdentification.accountNumber) && + Objects.equals(this.type, huLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HULocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HULocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (HULocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in HULocalAccountIdentification is not found in the empty JSON string", HULocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HULocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HULocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HULocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HULocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HULocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HULocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HULocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HULocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HULocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of HULocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to HULocalAccountIdentification + */ + public static HULocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HULocalAccountIdentification.class); + } + + /** + * Convert an instance of HULocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java new file mode 100644 index 000000000..fbe78d5b5 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java @@ -0,0 +1,298 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * IbanAccountIdentification + */ + +public class IbanAccountIdentification { + public static final String SERIALIZED_NAME_IBAN = "iban"; + @SerializedName(SERIALIZED_NAME_IBAN) + private String iban; + + /** + * **iban** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + IBAN("iban"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.IBAN; + + public IbanAccountIdentification() { + } + + public IbanAccountIdentification iban(String iban) { + + this.iban = iban; + return this; + } + + /** + * The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * @return iban + **/ + @ApiModelProperty(required = true, value = "The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard.") + + public String getIban() { + return iban; + } + + + public void setIban(String iban) { + this.iban = iban; + } + + + public IbanAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **iban** + * @return type + **/ + @ApiModelProperty(required = true, value = "**iban**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IbanAccountIdentification ibanAccountIdentification = (IbanAccountIdentification) o; + return Objects.equals(this.iban, ibanAccountIdentification.iban) && + Objects.equals(this.type, ibanAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(iban, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IbanAccountIdentification {\n"); + sb.append(" iban: ").append(toIndentedString(iban)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("iban"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("iban"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IbanAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (IbanAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in IbanAccountIdentification is not found in the empty JSON string", IbanAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IbanAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IbanAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IbanAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field iban + if (jsonObj.get("iban") != null && !jsonObj.get("iban").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `iban` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iban").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IbanAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IbanAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IbanAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IbanAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IbanAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IbanAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of IbanAccountIdentification + * @throws IOException if the JSON string is invalid with respect to IbanAccountIdentification + */ + public static IbanAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IbanAccountIdentification.class); + } + + /** + * Convert an instance of IbanAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/JSON.java b/src/main/java/com/adyen/model/balanceplatform/JSON.java index f0c1f3629..508ebee39 100644 --- a/src/main/java/com/adyen/model/balanceplatform/JSON.java +++ b/src/main/java/com/adyen/model/balanceplatform/JSON.java @@ -92,34 +92,44 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.AULocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.AccountHolder.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.AccountHolderCapability.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.AccountHolderInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.AccountSupportingEntityCapability.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.ActiveNetworkTokensRestriction.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.AdditionalBankIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Address.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Address2.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Amount.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Authentication.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Balance.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.BalanceAccount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.BalanceAccountBase.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.BalanceAccountInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.BalanceAccountUpdateRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.BalancePlatform.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.BalanceSweepConfigurationsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.BankAccount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.BankAccountIdentificationValidationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.BankAccountIdentificationValidationRequestAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.BrandVariantsRestriction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.BulkAddress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.CALocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.CZLocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Card.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.CardConfiguration.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.CardInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.ContactDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.CountriesRestriction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.CronSweepSchedule.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.DayOfWeekRestriction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.DeliveryContact.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.DifferentCurrenciesRestriction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Duration.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.EntryModesRestriction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Expiry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.HULocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.IbanAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.InternationalTransactionRestriction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.InvalidField.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.JSONObject.CustomTypeAdapterFactory()); @@ -127,21 +137,29 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.MatchingTransactionsRestriction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.MccsRestriction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.MerchantAcquirerPair.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.MerchantNamesRestriction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.MerchantsRestriction.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.NOLocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Name.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.NumberAndBicAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.PLLocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.PaginatedAccountHoldersResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.PaginatedBalanceAccountsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.PaginatedPaymentInstrumentsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.PaymentInstrument.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.PaymentInstrumentBankAccount.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.PaymentInstrumentGroup.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.PaymentInstrumentGroupInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.PaymentInstrumentInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.PaymentInstrumentRevealInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.PaymentInstrumentUpdateRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Phone.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.PhoneNumber.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.ProcessingTypesRestriction.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.RemediatingAction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.RestServiceError.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.SELocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.SGLocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.StringMatch.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.SweepConfigurationV2.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.SweepConfigurationV2Schedule.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.SweepCounterparty.CustomTypeAdapterFactory()); @@ -156,8 +174,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.TransactionRuleResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.TransactionRuleRestrictions.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.TransactionRulesResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.VerificationError.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.VerificationErrorRecursive.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.UKLocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.USLocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.UpdatePaymentInstrument.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.VerificationDeadline.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } diff --git a/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java new file mode 100644 index 000000000..069c66538 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java @@ -0,0 +1,268 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balanceplatform.StringMatch; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * MerchantNamesRestriction + */ + +public class MerchantNamesRestriction { + public static final String SERIALIZED_NAME_OPERATION = "operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + private String operation; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private List value = null; + + public MerchantNamesRestriction() { + } + + public MerchantNamesRestriction operation(String operation) { + + this.operation = operation; + return this; + } + + /** + * Defines how the condition must be evaluated. + * @return operation + **/ + @ApiModelProperty(required = true, value = "Defines how the condition must be evaluated.") + + public String getOperation() { + return operation; + } + + + public void setOperation(String operation) { + this.operation = operation; + } + + + public MerchantNamesRestriction value(List value) { + + this.value = value; + return this; + } + + public MerchantNamesRestriction addValueItem(StringMatch valueItem) { + if (this.value == null) { + this.value = new ArrayList<>(); + } + this.value.add(valueItem); + return this; + } + + /** + * Get value + * @return value + **/ + @ApiModelProperty(value = "") + + public List getValue() { + return value; + } + + + public void setValue(List value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MerchantNamesRestriction merchantNamesRestriction = (MerchantNamesRestriction) o; + return Objects.equals(this.operation, merchantNamesRestriction.operation) && + Objects.equals(this.value, merchantNamesRestriction.value); + } + + @Override + public int hashCode() { + return Objects.hash(operation, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MerchantNamesRestriction {\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("operation"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("operation"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MerchantNamesRestriction + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MerchantNamesRestriction.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MerchantNamesRestriction is not found in the empty JSON string", MerchantNamesRestriction.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MerchantNamesRestriction.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MerchantNamesRestriction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MerchantNamesRestriction.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field operation + if (jsonObj.get("operation") != null && !jsonObj.get("operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); + } + JsonArray jsonArrayvalue = jsonObj.getAsJsonArray("value"); + if (jsonArrayvalue != null) { + // ensure the json data is an array + if (!jsonObj.get("value").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + + // validate the optional field `value` (array) + for (int i = 0; i < jsonArrayvalue.size(); i++) { + StringMatch.validateJsonObject(jsonArrayvalue.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MerchantNamesRestriction.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MerchantNamesRestriction' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MerchantNamesRestriction.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MerchantNamesRestriction value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MerchantNamesRestriction read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MerchantNamesRestriction given an JSON string + * + * @param jsonString JSON string + * @return An instance of MerchantNamesRestriction + * @throws IOException if the JSON string is invalid with respect to MerchantNamesRestriction + */ + public static MerchantNamesRestriction fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MerchantNamesRestriction.class); + } + + /** + * Convert an instance of MerchantNamesRestriction to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java new file mode 100644 index 000000000..b8073b94a --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java @@ -0,0 +1,298 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * NOLocalAccountIdentification + */ + +public class NOLocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + /** + * **noLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + NOLOCAL("noLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.NOLOCAL; + + public NOLocalAccountIdentification() { + } + + public NOLocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 11-digit bank account number, without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 11-digit bank account number, without separators or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public NOLocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **noLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**noLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NOLocalAccountIdentification noLocalAccountIdentification = (NOLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, noLocalAccountIdentification.accountNumber) && + Objects.equals(this.type, noLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NOLocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NOLocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NOLocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NOLocalAccountIdentification is not found in the empty JSON string", NOLocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NOLocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NOLocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NOLocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NOLocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NOLocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NOLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NOLocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NOLocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NOLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of NOLocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to NOLocalAccountIdentification + */ + public static NOLocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NOLocalAccountIdentification.class); + } + + /** + * Convert an instance of NOLocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java new file mode 100644 index 000000000..03d328275 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java @@ -0,0 +1,366 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balanceplatform.AdditionalBankIdentification; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * NumberAndBicAccountIdentification + */ + +public class NumberAndBicAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_ADDITIONAL_BANK_IDENTIFICATION = "additionalBankIdentification"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_BANK_IDENTIFICATION) + private AdditionalBankIdentification additionalBankIdentification; + + public static final String SERIALIZED_NAME_BIC = "bic"; + @SerializedName(SERIALIZED_NAME_BIC) + private String bic; + + /** + * **numberAndBic** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + NUMBERANDBIC("numberAndBic"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.NUMBERANDBIC; + + public NumberAndBicAccountIdentification() { + } + + public NumberAndBicAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The bank account number, without separators or whitespace. The length and format depends on the bank or country. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The bank account number, without separators or whitespace. The length and format depends on the bank or country.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public NumberAndBicAccountIdentification additionalBankIdentification(AdditionalBankIdentification additionalBankIdentification) { + + this.additionalBankIdentification = additionalBankIdentification; + return this; + } + + /** + * Get additionalBankIdentification + * @return additionalBankIdentification + **/ + @ApiModelProperty(value = "") + + public AdditionalBankIdentification getAdditionalBankIdentification() { + return additionalBankIdentification; + } + + + public void setAdditionalBankIdentification(AdditionalBankIdentification additionalBankIdentification) { + this.additionalBankIdentification = additionalBankIdentification; + } + + + public NumberAndBicAccountIdentification bic(String bic) { + + this.bic = bic; + return this; + } + + /** + * The bank's 8- or 11-character BIC or SWIFT code. + * @return bic + **/ + @ApiModelProperty(required = true, value = "The bank's 8- or 11-character BIC or SWIFT code.") + + public String getBic() { + return bic; + } + + + public void setBic(String bic) { + this.bic = bic; + } + + + public NumberAndBicAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **numberAndBic** + * @return type + **/ + @ApiModelProperty(required = true, value = "**numberAndBic**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberAndBicAccountIdentification numberAndBicAccountIdentification = (NumberAndBicAccountIdentification) o; + return Objects.equals(this.accountNumber, numberAndBicAccountIdentification.accountNumber) && + Objects.equals(this.additionalBankIdentification, numberAndBicAccountIdentification.additionalBankIdentification) && + Objects.equals(this.bic, numberAndBicAccountIdentification.bic) && + Objects.equals(this.type, numberAndBicAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, additionalBankIdentification, bic, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberAndBicAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" additionalBankIdentification: ").append(toIndentedString(additionalBankIdentification)).append("\n"); + sb.append(" bic: ").append(toIndentedString(bic)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("additionalBankIdentification"); + openapiFields.add("bic"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("bic"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NumberAndBicAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NumberAndBicAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NumberAndBicAccountIdentification is not found in the empty JSON string", NumberAndBicAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NumberAndBicAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NumberAndBicAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NumberAndBicAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // validate the optional field `additionalBankIdentification` + if (jsonObj.getAsJsonObject("additionalBankIdentification") != null) { + AdditionalBankIdentification.validateJsonObject(jsonObj.getAsJsonObject("additionalBankIdentification")); + } + // validate the optional field bic + if (jsonObj.get("bic") != null && !jsonObj.get("bic").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bic` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bic").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NumberAndBicAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NumberAndBicAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NumberAndBicAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NumberAndBicAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NumberAndBicAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NumberAndBicAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of NumberAndBicAccountIdentification + * @throws IOException if the JSON string is invalid with respect to NumberAndBicAccountIdentification + */ + public static NumberAndBicAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NumberAndBicAccountIdentification.class); + } + + /** + * Convert an instance of NumberAndBicAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java new file mode 100644 index 000000000..941b2cb60 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java @@ -0,0 +1,298 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * PLLocalAccountIdentification + */ + +public class PLLocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + /** + * **plLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + PLLOCAL("plLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.PLLOCAL; + + public PLLocalAccountIdentification() { + } + + public PLLocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 26-digit bank account number ([Numer rachunku](https://pl.wikipedia.org/wiki/Numer_Rachunku_Bankowego)), without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 26-digit bank account number ([Numer rachunku](https://pl.wikipedia.org/wiki/Numer_Rachunku_Bankowego)), without separators or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public PLLocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **plLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**plLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PLLocalAccountIdentification plLocalAccountIdentification = (PLLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, plLocalAccountIdentification.accountNumber) && + Objects.equals(this.type, plLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PLLocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PLLocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PLLocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PLLocalAccountIdentification is not found in the empty JSON string", PLLocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PLLocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PLLocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PLLocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PLLocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PLLocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PLLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PLLocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PLLocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PLLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of PLLocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to PLLocalAccountIdentification + */ + public static PLLocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PLLocalAccountIdentification.class); + } + + /** + * Convert an instance of PLLocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java index a6bdf4382..a2fa28b67 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java @@ -14,7 +14,7 @@ import java.util.Objects; import java.util.Arrays; -import com.adyen.model.balanceplatform.BalanceAccount; +import com.adyen.model.balanceplatform.BalanceAccountBase; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -53,7 +53,7 @@ public class PaginatedBalanceAccountsResponse { public static final String SERIALIZED_NAME_BALANCE_ACCOUNTS = "balanceAccounts"; @SerializedName(SERIALIZED_NAME_BALANCE_ACCOUNTS) - private List balanceAccounts = new ArrayList<>(); + private List balanceAccounts = new ArrayList<>(); public static final String SERIALIZED_NAME_HAS_NEXT = "hasNext"; @SerializedName(SERIALIZED_NAME_HAS_NEXT) @@ -66,13 +66,13 @@ public class PaginatedBalanceAccountsResponse { public PaginatedBalanceAccountsResponse() { } - public PaginatedBalanceAccountsResponse balanceAccounts(List balanceAccounts) { + public PaginatedBalanceAccountsResponse balanceAccounts(List balanceAccounts) { this.balanceAccounts = balanceAccounts; return this; } - public PaginatedBalanceAccountsResponse addBalanceAccountsItem(BalanceAccount balanceAccountsItem) { + public PaginatedBalanceAccountsResponse addBalanceAccountsItem(BalanceAccountBase balanceAccountsItem) { this.balanceAccounts.add(balanceAccountsItem); return this; } @@ -83,12 +83,12 @@ public PaginatedBalanceAccountsResponse addBalanceAccountsItem(BalanceAccount ba **/ @ApiModelProperty(required = true, value = "List of balance accounts.") - public List getBalanceAccounts() { + public List getBalanceAccounts() { return balanceAccounts; } - public void setBalanceAccounts(List balanceAccounts) { + public void setBalanceAccounts(List balanceAccounts) { this.balanceAccounts = balanceAccounts; } @@ -235,7 +235,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `balanceAccounts` (array) for (int i = 0; i < jsonArraybalanceAccounts.size(); i++) { - BalanceAccount.validateJsonObject(jsonArraybalanceAccounts.get(i).getAsJsonObject()); + BalanceAccountBase.validateJsonObject(jsonArraybalanceAccounts.get(i).getAsJsonObject()); }; } } diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java index fa2e0a986..4ad745a50 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java @@ -14,8 +14,8 @@ import java.util.Objects; import java.util.Arrays; -import com.adyen.model.balanceplatform.BankAccount; import com.adyen.model.balanceplatform.Card; +import com.adyen.model.balanceplatform.PaymentInstrumentBankAccount; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -56,7 +56,7 @@ public class PaymentInstrument { public static final String SERIALIZED_NAME_BANK_ACCOUNT = "bankAccount"; @SerializedName(SERIALIZED_NAME_BANK_ACCOUNT) - private BankAccount bankAccount; + private PaymentInstrumentBankAccount bankAccount; public static final String SERIALIZED_NAME_CARD = "card"; @SerializedName(SERIALIZED_NAME_CARD) @@ -276,7 +276,7 @@ public void setBalanceAccountId(String balanceAccountId) { } - public PaymentInstrument bankAccount(BankAccount bankAccount) { + public PaymentInstrument bankAccount(PaymentInstrumentBankAccount bankAccount) { this.bankAccount = bankAccount; return this; @@ -288,12 +288,12 @@ public PaymentInstrument bankAccount(BankAccount bankAccount) { **/ @ApiModelProperty(value = "") - public BankAccount getBankAccount() { + public PaymentInstrumentBankAccount getBankAccount() { return bankAccount; } - public void setBankAccount(BankAccount bankAccount) { + public void setBankAccount(PaymentInstrumentBankAccount bankAccount) { this.bankAccount = bankAccount; } @@ -616,7 +616,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field `bankAccount` if (jsonObj.getAsJsonObject("bankAccount") != null) { - BankAccount.validateJsonObject(jsonObj.getAsJsonObject("bankAccount")); + PaymentInstrumentBankAccount.validateJsonObject(jsonObj.getAsJsonObject("bankAccount")); } // validate the optional field `card` if (jsonObj.getAsJsonObject("card") != null) { diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java new file mode 100644 index 000000000..0ead638d3 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java @@ -0,0 +1,285 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balanceplatform.IbanAccountIdentification; +import com.adyen.model.balanceplatform.USLocalAccountIdentification; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import javax.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import com.adyen.model.balanceplatform.JSON; + + +public class PaymentInstrumentBankAccount extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(PaymentInstrumentBankAccount.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PaymentInstrumentBankAccount.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PaymentInstrumentBankAccount' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterIbanAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(IbanAccountIdentification.class)); + final TypeAdapter adapterUSLocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(USLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PaymentInstrumentBankAccount value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `IbanAccountIdentification` + if (value.getActualInstance() instanceof IbanAccountIdentification) { + JsonObject obj = adapterIbanAccountIdentification.toJsonTree((IbanAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `USLocalAccountIdentification` + if (value.getActualInstance() instanceof USLocalAccountIdentification) { + JsonObject obj = adapterUSLocalAccountIdentification.toJsonTree((USLocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: IbanAccountIdentification, USLocalAccountIdentification"); + } + + @Override + public PaymentInstrumentBankAccount read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize IbanAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + IbanAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterIbanAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'IbanAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IbanAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IbanAccountIdentification'", e); + } + + // deserialize USLocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + USLocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterUSLocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'USLocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for USLocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'USLocalAccountIdentification'", e); + } + + if (match == 1) { + PaymentInstrumentBankAccount ret = new PaymentInstrumentBankAccount(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for PaymentInstrumentBankAccount: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public PaymentInstrumentBankAccount() { + super("oneOf", Boolean.FALSE); + } + + public PaymentInstrumentBankAccount(IbanAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public PaymentInstrumentBankAccount(USLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("IbanAccountIdentification", new GenericType() { + }); + schemas.put("USLocalAccountIdentification", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return PaymentInstrumentBankAccount.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * IbanAccountIdentification, USLocalAccountIdentification + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof IbanAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof USLocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be IbanAccountIdentification, USLocalAccountIdentification"); + } + + /** + * Get the actual instance, which can be the following: + * IbanAccountIdentification, USLocalAccountIdentification + * + * @return The actual instance (IbanAccountIdentification, USLocalAccountIdentification) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `IbanAccountIdentification`. If the actual instance is not `IbanAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IbanAccountIdentification` + * @throws ClassCastException if the instance is not `IbanAccountIdentification` + */ + public IbanAccountIdentification getIbanAccountIdentification() throws ClassCastException { + return (IbanAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `USLocalAccountIdentification`. If the actual instance is not `USLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `USLocalAccountIdentification` + * @throws ClassCastException if the instance is not `USLocalAccountIdentification` + */ + public USLocalAccountIdentification getUSLocalAccountIdentification() throws ClassCastException { + return (USLocalAccountIdentification)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PaymentInstrumentBankAccount + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with IbanAccountIdentification + try { + IbanAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IbanAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with USLocalAccountIdentification + try { + USLocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for USLocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for PaymentInstrumentBankAccount with oneOf schemas: IbanAccountIdentification, USLocalAccountIdentification. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of PaymentInstrumentBankAccount given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentInstrumentBankAccount + * @throws IOException if the JSON string is invalid with respect to PaymentInstrumentBankAccount + */ + public static PaymentInstrumentBankAccount fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PaymentInstrumentBankAccount.class); + } + + /** + * Convert an instance of PaymentInstrumentBankAccount to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java new file mode 100644 index 000000000..367d95a38 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java @@ -0,0 +1,285 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balanceplatform.Expiry; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * PaymentInstrumentRevealInfo + */ + +public class PaymentInstrumentRevealInfo { + public static final String SERIALIZED_NAME_CVC = "cvc"; + @SerializedName(SERIALIZED_NAME_CVC) + private String cvc; + + public static final String SERIALIZED_NAME_EXPIRATION = "expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + private Expiry expiration; + + public static final String SERIALIZED_NAME_PAN = "pan"; + @SerializedName(SERIALIZED_NAME_PAN) + private String pan; + + public PaymentInstrumentRevealInfo() { + } + + public PaymentInstrumentRevealInfo cvc(String cvc) { + + this.cvc = cvc; + return this; + } + + /** + * The CVC2 value of the card. + * @return cvc + **/ + @ApiModelProperty(required = true, value = "The CVC2 value of the card.") + + public String getCvc() { + return cvc; + } + + + public void setCvc(String cvc) { + this.cvc = cvc; + } + + + public PaymentInstrumentRevealInfo expiration(Expiry expiration) { + + this.expiration = expiration; + return this; + } + + /** + * Get expiration + * @return expiration + **/ + @ApiModelProperty(required = true, value = "") + + public Expiry getExpiration() { + return expiration; + } + + + public void setExpiration(Expiry expiration) { + this.expiration = expiration; + } + + + public PaymentInstrumentRevealInfo pan(String pan) { + + this.pan = pan; + return this; + } + + /** + * The primary account number (PAN) of the card. + * @return pan + **/ + @ApiModelProperty(required = true, value = "The primary account number (PAN) of the card.") + + public String getPan() { + return pan; + } + + + public void setPan(String pan) { + this.pan = pan; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentInstrumentRevealInfo paymentInstrumentRevealInfo = (PaymentInstrumentRevealInfo) o; + return Objects.equals(this.cvc, paymentInstrumentRevealInfo.cvc) && + Objects.equals(this.expiration, paymentInstrumentRevealInfo.expiration) && + Objects.equals(this.pan, paymentInstrumentRevealInfo.pan); + } + + @Override + public int hashCode() { + return Objects.hash(cvc, expiration, pan); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentInstrumentRevealInfo {\n"); + sb.append(" cvc: ").append(toIndentedString(cvc)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" pan: ").append(toIndentedString(pan)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cvc"); + openapiFields.add("expiration"); + openapiFields.add("pan"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("cvc"); + openapiRequiredFields.add("expiration"); + openapiRequiredFields.add("pan"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PaymentInstrumentRevealInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PaymentInstrumentRevealInfo.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PaymentInstrumentRevealInfo is not found in the empty JSON string", PaymentInstrumentRevealInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PaymentInstrumentRevealInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrumentRevealInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PaymentInstrumentRevealInfo.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field cvc + if (jsonObj.get("cvc") != null && !jsonObj.get("cvc").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cvc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvc").toString())); + } + // validate the optional field `expiration` + if (jsonObj.getAsJsonObject("expiration") != null) { + Expiry.validateJsonObject(jsonObj.getAsJsonObject("expiration")); + } + // validate the optional field pan + if (jsonObj.get("pan") != null && !jsonObj.get("pan").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PaymentInstrumentRevealInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PaymentInstrumentRevealInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PaymentInstrumentRevealInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PaymentInstrumentRevealInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PaymentInstrumentRevealInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PaymentInstrumentRevealInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentInstrumentRevealInfo + * @throws IOException if the JSON string is invalid with respect to PaymentInstrumentRevealInfo + */ + public static PaymentInstrumentRevealInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PaymentInstrumentRevealInfo.class); + } + + /** + * Convert an instance of PaymentInstrumentRevealInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java b/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java index 17c5058f1..a4bcdc025 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java +++ b/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java @@ -124,7 +124,7 @@ public PhoneNumber phoneCountryCode(String phoneCountryCode) { * The two-character ISO-3166-1 alpha-2 country code of the phone number. For example, **US** or **NL**. * @return phoneCountryCode **/ - @ApiModelProperty(required = true, value = "The two-character ISO-3166-1 alpha-2 country code of the phone number. For example, **US** or **NL**.") + @ApiModelProperty(value = "The two-character ISO-3166-1 alpha-2 country code of the phone number. For example, **US** or **NL**.") public String getPhoneCountryCode() { return phoneCountryCode; @@ -146,7 +146,7 @@ public PhoneNumber phoneNumber(String phoneNumber) { * The phone number. The inclusion of the phone number country code is not necessary. * @return phoneNumber **/ - @ApiModelProperty(required = true, value = "The phone number. The inclusion of the phone number country code is not necessary.") + @ApiModelProperty(value = "The phone number. The inclusion of the phone number country code is not necessary.") public String getPhoneNumber() { return phoneNumber; @@ -235,8 +235,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("phoneCountryCode"); - openapiRequiredFields.add("phoneNumber"); } /** @@ -261,13 +259,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PhoneNumber` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : PhoneNumber.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } // validate the optional field phoneCountryCode if (jsonObj.get("phoneCountryCode") != null && !jsonObj.get("phoneCountryCode").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `phoneCountryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneCountryCode").toString())); diff --git a/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java new file mode 100644 index 000000000..55f4a30c1 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java @@ -0,0 +1,332 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * SELocalAccountIdentification + */ + +public class SELocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_CLEARING_NUMBER = "clearingNumber"; + @SerializedName(SERIALIZED_NAME_CLEARING_NUMBER) + private String clearingNumber; + + /** + * **seLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + SELOCAL("seLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.SELOCAL; + + public SELocalAccountIdentification() { + } + + public SELocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 7- to 10-digit bank account number ([Bankkontonummer](https://sv.wikipedia.org/wiki/Bankkonto)), without the clearing number, separators, or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 7- to 10-digit bank account number ([Bankkontonummer](https://sv.wikipedia.org/wiki/Bankkonto)), without the clearing number, separators, or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public SELocalAccountIdentification clearingNumber(String clearingNumber) { + + this.clearingNumber = clearingNumber; + return this; + } + + /** + * The 4- to 5-digit clearing number ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or whitespace. + * @return clearingNumber + **/ + @ApiModelProperty(required = true, value = "The 4- to 5-digit clearing number ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or whitespace.") + + public String getClearingNumber() { + return clearingNumber; + } + + + public void setClearingNumber(String clearingNumber) { + this.clearingNumber = clearingNumber; + } + + + public SELocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **seLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**seLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SELocalAccountIdentification seLocalAccountIdentification = (SELocalAccountIdentification) o; + return Objects.equals(this.accountNumber, seLocalAccountIdentification.accountNumber) && + Objects.equals(this.clearingNumber, seLocalAccountIdentification.clearingNumber) && + Objects.equals(this.type, seLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, clearingNumber, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SELocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" clearingNumber: ").append(toIndentedString(clearingNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("clearingNumber"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("clearingNumber"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SELocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SELocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SELocalAccountIdentification is not found in the empty JSON string", SELocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SELocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SELocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SELocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // validate the optional field clearingNumber + if (jsonObj.get("clearingNumber") != null && !jsonObj.get("clearingNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clearingNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clearingNumber").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SELocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SELocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SELocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SELocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SELocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SELocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of SELocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to SELocalAccountIdentification + */ + public static SELocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SELocalAccountIdentification.class); + } + + /** + * Convert an instance of SELocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java new file mode 100644 index 000000000..4ef8f04c2 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java @@ -0,0 +1,331 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * SGLocalAccountIdentification + */ + +public class SGLocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_BIC = "bic"; + @SerializedName(SERIALIZED_NAME_BIC) + private String bic; + + /** + * **sgLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + SGLOCAL("sgLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.SGLOCAL; + + public SGLocalAccountIdentification() { + } + + public SGLocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 4- to 19-digit bank account number, without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 4- to 19-digit bank account number, without separators or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public SGLocalAccountIdentification bic(String bic) { + + this.bic = bic; + return this; + } + + /** + * The bank's 8- or 11-character BIC or SWIFT code. + * @return bic + **/ + @ApiModelProperty(required = true, value = "The bank's 8- or 11-character BIC or SWIFT code.") + + public String getBic() { + return bic; + } + + + public void setBic(String bic) { + this.bic = bic; + } + + + public SGLocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **sgLocal** + * @return type + **/ + @ApiModelProperty(value = "**sgLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SGLocalAccountIdentification sgLocalAccountIdentification = (SGLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, sgLocalAccountIdentification.accountNumber) && + Objects.equals(this.bic, sgLocalAccountIdentification.bic) && + Objects.equals(this.type, sgLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, bic, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SGLocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" bic: ").append(toIndentedString(bic)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("bic"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("bic"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SGLocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SGLocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SGLocalAccountIdentification is not found in the empty JSON string", SGLocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SGLocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SGLocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SGLocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // validate the optional field bic + if (jsonObj.get("bic") != null && !jsonObj.get("bic").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bic` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bic").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SGLocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SGLocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SGLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SGLocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SGLocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SGLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of SGLocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to SGLocalAccountIdentification + */ + public static SGLocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SGLocalAccountIdentification.class); + } + + /** + * Convert an instance of SGLocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/StringMatch.java b/src/main/java/com/adyen/model/balanceplatform/StringMatch.java new file mode 100644 index 000000000..3050dc143 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/StringMatch.java @@ -0,0 +1,295 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * StringMatch + */ + +public class StringMatch { + /** + * The type of string matching operation. Possible values: **startsWith**, **endsWith**, **isEqualTo**, **contains**, + */ + @JsonAdapter(OperationEnum.Adapter.class) + public enum OperationEnum { + CONTAINS("contains"), + + ENDSWITH("endsWith"), + + ISEQUALTO("isEqualTo"), + + STARTSWITH("startsWith"); + + private String value; + + OperationEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OperationEnum fromValue(String value) { + for (OperationEnum b : OperationEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final OperationEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OperationEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OperationEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_OPERATION = "operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + private OperationEnum operation; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public StringMatch() { + } + + public StringMatch operation(OperationEnum operation) { + + this.operation = operation; + return this; + } + + /** + * The type of string matching operation. Possible values: **startsWith**, **endsWith**, **isEqualTo**, **contains**, + * @return operation + **/ + @ApiModelProperty(value = "The type of string matching operation. Possible values: **startsWith**, **endsWith**, **isEqualTo**, **contains**,") + + public OperationEnum getOperation() { + return operation; + } + + + public void setOperation(OperationEnum operation) { + this.operation = operation; + } + + + public StringMatch value(String value) { + + this.value = value; + return this; + } + + /** + * The string to be matched. + * @return value + **/ + @ApiModelProperty(value = "The string to be matched.") + + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StringMatch stringMatch = (StringMatch) o; + return Objects.equals(this.operation, stringMatch.operation) && + Objects.equals(this.value, stringMatch.value); + } + + @Override + public int hashCode() { + return Objects.hash(operation, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StringMatch {\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("operation"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StringMatch + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (StringMatch.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in StringMatch is not found in the empty JSON string", StringMatch.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StringMatch.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StringMatch` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the field operation can be parsed to an enum value + if (jsonObj.get("operation") != null) { + if(!jsonObj.get("operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); + } + OperationEnum.fromValue(jsonObj.get("operation").getAsString()); + } + // validate the optional field value + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StringMatch.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StringMatch' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StringMatch.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StringMatch value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StringMatch read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StringMatch given an JSON string + * + * @param jsonString JSON string + * @return An instance of StringMatch + * @throws IOException if the JSON string is invalid with respect to StringMatch + */ + public static StringMatch fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StringMatch.class); + } + + /** + * Convert an instance of StringMatch to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java index 1c9079491..9c0a8962b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java @@ -25,6 +25,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -51,6 +53,59 @@ */ public class SweepConfigurationV2 { + /** + * The type of transfer that results from the sweep. Possible values: - **bank**: Sweep to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. Required when setting `priorities`. + */ + @JsonAdapter(CategoryEnum.Adapter.class) + public enum CategoryEnum { + BANK("bank"), + + INTERNAL("internal"), + + PLATFORMPAYMENT("platformPayment"); + + private String value; + + CategoryEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CategoryEnum fromValue(String value) { + for (CategoryEnum b : CategoryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CategoryEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CategoryEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CategoryEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_CATEGORY = "category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + private CategoryEnum category; + public static final String SERIALIZED_NAME_COUNTERPARTY = "counterparty"; @SerializedName(SERIALIZED_NAME_COUNTERPARTY) private SweepCounterparty counterparty; @@ -67,6 +122,140 @@ public class SweepConfigurationV2 { @SerializedName(SERIALIZED_NAME_ID) private String id; + /** + * Gets or Sets priorities + */ + @JsonAdapter(PrioritiesEnum.Adapter.class) + public enum PrioritiesEnum { + CROSSBORDER("crossBorder"), + + DIRECTDEBIT("directDebit"), + + FAST("fast"), + + INSTANT("instant"), + + INTERNAL("internal"), + + REGULAR("regular"), + + WIRE("wire"); + + private String value; + + PrioritiesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PrioritiesEnum fromValue(String value) { + for (PrioritiesEnum b : PrioritiesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final PrioritiesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PrioritiesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PrioritiesEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PRIORITIES = "priorities"; + @SerializedName(SERIALIZED_NAME_PRIORITIES) + private List priorities = null; + + /** + * The reason for disabling the sweep. + */ + @JsonAdapter(ReasonEnum.Adapter.class) + public enum ReasonEnum { + AMOUNTLIMITEXCEEDED("amountLimitExceeded"), + + APPROVED("approved"), + + COUNTERPARTYACCOUNTBLOCKED("counterpartyAccountBlocked"), + + COUNTERPARTYACCOUNTCLOSED("counterpartyAccountClosed"), + + COUNTERPARTYACCOUNTNOTFOUND("counterpartyAccountNotFound"), + + COUNTERPARTYADDRESSREQUIRED("counterpartyAddressRequired"), + + COUNTERPARTYBANKTIMEDOUT("counterpartyBankTimedOut"), + + COUNTERPARTYBANKUNAVAILABLE("counterpartyBankUnavailable"), + + ERROR("error"), + + NOTENOUGHBALANCE("notEnoughBalance"), + + REFUSEDBYCOUNTERPARTYBANK("refusedByCounterpartyBank"), + + ROUTENOTFOUND("routeNotFound"), + + UNKNOWN("unknown"); + + private String value; + + ReasonEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ReasonEnum fromValue(String value) { + for (ReasonEnum b : ReasonEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ReasonEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ReasonEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ReasonEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_REASON = "reason"; + @SerializedName(SERIALIZED_NAME_REASON) + private ReasonEnum reason; + public static final String SERIALIZED_NAME_SCHEDULE = "schedule"; @SerializedName(SERIALIZED_NAME_SCHEDULE) private SweepConfigurationV2Schedule schedule; @@ -190,12 +379,36 @@ public SweepConfigurationV2() { public SweepConfigurationV2( - String id + String id, + ReasonEnum reason ) { this(); this.id = id; + this.reason = reason; + } + + public SweepConfigurationV2 category(CategoryEnum category) { + + this.category = category; + return this; + } + + /** + * The type of transfer that results from the sweep. Possible values: - **bank**: Sweep to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. Required when setting `priorities`. + * @return category + **/ + @ApiModelProperty(value = "The type of transfer that results from the sweep. Possible values: - **bank**: Sweep to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. Required when setting `priorities`.") + + public CategoryEnum getCategory() { + return category; + } + + + public void setCategory(CategoryEnum category) { + this.category = category; } + public SweepConfigurationV2 counterparty(SweepCounterparty counterparty) { this.counterparty = counterparty; @@ -275,6 +488,49 @@ public String getId() { + public SweepConfigurationV2 priorities(List priorities) { + + this.priorities = priorities; + return this; + } + + public SweepConfigurationV2 addPrioritiesItem(PrioritiesEnum prioritiesItem) { + if (this.priorities == null) { + this.priorities = new ArrayList<>(); + } + this.priorities.add(prioritiesItem); + return this; + } + + /** + * The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority listed first, and if that's not possible, it moves on to the next option in the order of provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see [optional priorities setup](https://docs.adyen.com/marketplaces-and-platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + * @return priorities + **/ + @ApiModelProperty(value = "The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority listed first, and if that's not possible, it moves on to the next option in the order of provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see [optional priorities setup](https://docs.adyen.com/marketplaces-and-platforms/payout-to-users/scheduled-payouts#optional-priorities-setup).") + + public List getPriorities() { + return priorities; + } + + + public void setPriorities(List priorities) { + this.priorities = priorities; + } + + + /** + * The reason for disabling the sweep. + * @return reason + **/ + @ApiModelProperty(value = "The reason for disabling the sweep.") + + public ReasonEnum getReason() { + return reason; + } + + + + public SweepConfigurationV2 schedule(SweepConfigurationV2Schedule schedule) { this.schedule = schedule; @@ -417,10 +673,13 @@ public boolean equals(Object o) { return false; } SweepConfigurationV2 sweepConfigurationV2 = (SweepConfigurationV2) o; - return Objects.equals(this.counterparty, sweepConfigurationV2.counterparty) && + return Objects.equals(this.category, sweepConfigurationV2.category) && + Objects.equals(this.counterparty, sweepConfigurationV2.counterparty) && Objects.equals(this.currency, sweepConfigurationV2.currency) && Objects.equals(this.description, sweepConfigurationV2.description) && Objects.equals(this.id, sweepConfigurationV2.id) && + Objects.equals(this.priorities, sweepConfigurationV2.priorities) && + Objects.equals(this.reason, sweepConfigurationV2.reason) && Objects.equals(this.schedule, sweepConfigurationV2.schedule) && Objects.equals(this.status, sweepConfigurationV2.status) && Objects.equals(this.sweepAmount, sweepConfigurationV2.sweepAmount) && @@ -431,17 +690,20 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(counterparty, currency, description, id, schedule, status, sweepAmount, targetAmount, triggerAmount, type); + return Objects.hash(category, counterparty, currency, description, id, priorities, reason, schedule, status, sweepAmount, targetAmount, triggerAmount, type); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SweepConfigurationV2 {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); sb.append(" counterparty: ").append(toIndentedString(counterparty)).append("\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" priorities: ").append(toIndentedString(priorities)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); sb.append(" schedule: ").append(toIndentedString(schedule)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" sweepAmount: ").append(toIndentedString(sweepAmount)).append("\n"); @@ -470,10 +732,13 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("category"); openapiFields.add("counterparty"); openapiFields.add("currency"); openapiFields.add("description"); openapiFields.add("id"); + openapiFields.add("priorities"); + openapiFields.add("reason"); openapiFields.add("schedule"); openapiFields.add("status"); openapiFields.add("sweepAmount"); @@ -518,6 +783,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); } } + // ensure the field category can be parsed to an enum value + if (jsonObj.get("category") != null) { + if(!jsonObj.get("category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("category").toString())); + } + CategoryEnum.fromValue(jsonObj.get("category").getAsString()); + } // validate the optional field `counterparty` if (jsonObj.getAsJsonObject("counterparty") != null) { SweepCounterparty.validateJsonObject(jsonObj.getAsJsonObject("counterparty")); @@ -534,6 +806,17 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } + // ensure the json data is an array + if (jsonObj.get("priorities") != null && !jsonObj.get("priorities").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `priorities` to be an array in the JSON string but got `%s`", jsonObj.get("priorities").toString())); + } + // ensure the field reason can be parsed to an enum value + if (jsonObj.get("reason") != null) { + if(!jsonObj.get("reason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reason").toString())); + } + ReasonEnum.fromValue(jsonObj.get("reason").getAsString()); + } // validate the optional field `schedule` if (jsonObj.getAsJsonObject("schedule") != null) { SweepConfigurationV2Schedule.validateJsonObject(jsonObj.getAsJsonObject("schedule")); diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java index 800307a08..8df4673df 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java @@ -130,6 +130,59 @@ public OutcomeTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_REFERENCE) private String reference; + /** + * Indicates the type of request to which the rule applies. Possible values: **authorization**, **authentication**, **tokenization**. + */ + @JsonAdapter(RequestTypeEnum.Adapter.class) + public enum RequestTypeEnum { + AUTHENTICATION("authentication"), + + AUTHORIZATION("authorization"), + + TOKENIZATION("tokenization"); + + private String value; + + RequestTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RequestTypeEnum fromValue(String value) { + for (RequestTypeEnum b : RequestTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RequestTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RequestTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RequestTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_REQUEST_TYPE = "requestType"; + @SerializedName(SERIALIZED_NAME_REQUEST_TYPE) + private RequestTypeEnum requestType; + public static final String SERIALIZED_NAME_RULE_RESTRICTIONS = "ruleRestrictions"; @SerializedName(SERIALIZED_NAME_RULE_RESTRICTIONS) private TransactionRuleRestrictions ruleRestrictions; @@ -427,6 +480,28 @@ public void setReference(String reference) { } + public TransactionRule requestType(RequestTypeEnum requestType) { + + this.requestType = requestType; + return this; + } + + /** + * Indicates the type of request to which the rule applies. Possible values: **authorization**, **authentication**, **tokenization**. + * @return requestType + **/ + @ApiModelProperty(value = "Indicates the type of request to which the rule applies. Possible values: **authorization**, **authentication**, **tokenization**.") + + public RequestTypeEnum getRequestType() { + return requestType; + } + + + public void setRequestType(RequestTypeEnum requestType) { + this.requestType = requestType; + } + + public TransactionRule ruleRestrictions(TransactionRuleRestrictions ruleRestrictions) { this.ruleRestrictions = ruleRestrictions; @@ -555,6 +630,7 @@ public boolean equals(Object o) { Objects.equals(this.interval, transactionRule.interval) && Objects.equals(this.outcomeType, transactionRule.outcomeType) && Objects.equals(this.reference, transactionRule.reference) && + Objects.equals(this.requestType, transactionRule.requestType) && Objects.equals(this.ruleRestrictions, transactionRule.ruleRestrictions) && Objects.equals(this.score, transactionRule.score) && Objects.equals(this.startDate, transactionRule.startDate) && @@ -564,7 +640,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(aggregationLevel, description, endDate, entityKey, id, interval, outcomeType, reference, ruleRestrictions, score, startDate, status, type); + return Objects.hash(aggregationLevel, description, endDate, entityKey, id, interval, outcomeType, reference, requestType, ruleRestrictions, score, startDate, status, type); } @Override @@ -579,6 +655,7 @@ public String toString() { sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); sb.append(" outcomeType: ").append(toIndentedString(outcomeType)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" requestType: ").append(toIndentedString(requestType)).append("\n"); sb.append(" ruleRestrictions: ").append(toIndentedString(ruleRestrictions)).append("\n"); sb.append(" score: ").append(toIndentedString(score)).append("\n"); sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); @@ -614,6 +691,7 @@ private String toIndentedString(Object o) { openapiFields.add("interval"); openapiFields.add("outcomeType"); openapiFields.add("reference"); + openapiFields.add("requestType"); openapiFields.add("ruleRestrictions"); openapiFields.add("score"); openapiFields.add("startDate"); @@ -694,6 +772,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } + // ensure the field requestType can be parsed to an enum value + if (jsonObj.get("requestType") != null) { + if(!jsonObj.get("requestType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestType").toString())); + } + RequestTypeEnum.fromValue(jsonObj.get("requestType").getAsString()); + } // validate the optional field `ruleRestrictions` if (jsonObj.getAsJsonObject("ruleRestrictions") != null) { TransactionRuleRestrictions.validateJsonObject(jsonObj.getAsJsonObject("ruleRestrictions")); diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java index ea4efa992..187ce1885 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java @@ -126,6 +126,59 @@ public OutcomeTypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_REFERENCE) private String reference; + /** + * Indicates the type of request to which the rule applies. Possible values: **authorization**, **authentication**, **tokenization**. + */ + @JsonAdapter(RequestTypeEnum.Adapter.class) + public enum RequestTypeEnum { + AUTHENTICATION("authentication"), + + AUTHORIZATION("authorization"), + + TOKENIZATION("tokenization"); + + private String value; + + RequestTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RequestTypeEnum fromValue(String value) { + for (RequestTypeEnum b : RequestTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final RequestTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RequestTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RequestTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_REQUEST_TYPE = "requestType"; + @SerializedName(SERIALIZED_NAME_REQUEST_TYPE) + private RequestTypeEnum requestType; + public static final String SERIALIZED_NAME_RULE_RESTRICTIONS = "ruleRestrictions"; @SerializedName(SERIALIZED_NAME_RULE_RESTRICTIONS) private TransactionRuleRestrictions ruleRestrictions; @@ -401,6 +454,28 @@ public void setReference(String reference) { } + public TransactionRuleInfo requestType(RequestTypeEnum requestType) { + + this.requestType = requestType; + return this; + } + + /** + * Indicates the type of request to which the rule applies. Possible values: **authorization**, **authentication**, **tokenization**. + * @return requestType + **/ + @ApiModelProperty(value = "Indicates the type of request to which the rule applies. Possible values: **authorization**, **authentication**, **tokenization**.") + + public RequestTypeEnum getRequestType() { + return requestType; + } + + + public void setRequestType(RequestTypeEnum requestType) { + this.requestType = requestType; + } + + public TransactionRuleInfo ruleRestrictions(TransactionRuleRestrictions ruleRestrictions) { this.ruleRestrictions = ruleRestrictions; @@ -528,6 +603,7 @@ public boolean equals(Object o) { Objects.equals(this.interval, transactionRuleInfo.interval) && Objects.equals(this.outcomeType, transactionRuleInfo.outcomeType) && Objects.equals(this.reference, transactionRuleInfo.reference) && + Objects.equals(this.requestType, transactionRuleInfo.requestType) && Objects.equals(this.ruleRestrictions, transactionRuleInfo.ruleRestrictions) && Objects.equals(this.score, transactionRuleInfo.score) && Objects.equals(this.startDate, transactionRuleInfo.startDate) && @@ -537,7 +613,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(aggregationLevel, description, endDate, entityKey, interval, outcomeType, reference, ruleRestrictions, score, startDate, status, type); + return Objects.hash(aggregationLevel, description, endDate, entityKey, interval, outcomeType, reference, requestType, ruleRestrictions, score, startDate, status, type); } @Override @@ -551,6 +627,7 @@ public String toString() { sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); sb.append(" outcomeType: ").append(toIndentedString(outcomeType)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" requestType: ").append(toIndentedString(requestType)).append("\n"); sb.append(" ruleRestrictions: ").append(toIndentedString(ruleRestrictions)).append("\n"); sb.append(" score: ").append(toIndentedString(score)).append("\n"); sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); @@ -585,6 +662,7 @@ private String toIndentedString(Object o) { openapiFields.add("interval"); openapiFields.add("outcomeType"); openapiFields.add("reference"); + openapiFields.add("requestType"); openapiFields.add("ruleRestrictions"); openapiFields.add("score"); openapiFields.add("startDate"); @@ -661,6 +739,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } + // ensure the field requestType can be parsed to an enum value + if (jsonObj.get("requestType") != null) { + if(!jsonObj.get("requestType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestType").toString())); + } + RequestTypeEnum.fromValue(jsonObj.get("requestType").getAsString()); + } // validate the optional field `ruleRestrictions` if (jsonObj.getAsJsonObject("ruleRestrictions") != null) { TransactionRuleRestrictions.validateJsonObject(jsonObj.getAsJsonObject("ruleRestrictions")); diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java index 32ea65b28..4c8e199dc 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java @@ -17,11 +17,13 @@ import com.adyen.model.balanceplatform.ActiveNetworkTokensRestriction; import com.adyen.model.balanceplatform.BrandVariantsRestriction; import com.adyen.model.balanceplatform.CountriesRestriction; +import com.adyen.model.balanceplatform.DayOfWeekRestriction; import com.adyen.model.balanceplatform.DifferentCurrenciesRestriction; import com.adyen.model.balanceplatform.EntryModesRestriction; import com.adyen.model.balanceplatform.InternationalTransactionRestriction; import com.adyen.model.balanceplatform.MatchingTransactionsRestriction; import com.adyen.model.balanceplatform.MccsRestriction; +import com.adyen.model.balanceplatform.MerchantNamesRestriction; import com.adyen.model.balanceplatform.MerchantsRestriction; import com.adyen.model.balanceplatform.ProcessingTypesRestriction; import com.adyen.model.balanceplatform.TimeOfDayRestriction; @@ -72,6 +74,10 @@ public class TransactionRuleRestrictions { @SerializedName(SERIALIZED_NAME_COUNTRIES) private CountriesRestriction countries; + public static final String SERIALIZED_NAME_DAY_OF_WEEK = "dayOfWeek"; + @SerializedName(SERIALIZED_NAME_DAY_OF_WEEK) + private DayOfWeekRestriction dayOfWeek; + public static final String SERIALIZED_NAME_DIFFERENT_CURRENCIES = "differentCurrencies"; @SerializedName(SERIALIZED_NAME_DIFFERENT_CURRENCIES) private DifferentCurrenciesRestriction differentCurrencies; @@ -92,6 +98,10 @@ public class TransactionRuleRestrictions { @SerializedName(SERIALIZED_NAME_MCCS) private MccsRestriction mccs; + public static final String SERIALIZED_NAME_MERCHANT_NAMES = "merchantNames"; + @SerializedName(SERIALIZED_NAME_MERCHANT_NAMES) + private MerchantNamesRestriction merchantNames; + public static final String SERIALIZED_NAME_MERCHANTS = "merchants"; @SerializedName(SERIALIZED_NAME_MERCHANTS) private MerchantsRestriction merchants; @@ -177,6 +187,28 @@ public void setCountries(CountriesRestriction countries) { } + public TransactionRuleRestrictions dayOfWeek(DayOfWeekRestriction dayOfWeek) { + + this.dayOfWeek = dayOfWeek; + return this; + } + + /** + * Get dayOfWeek + * @return dayOfWeek + **/ + @ApiModelProperty(value = "") + + public DayOfWeekRestriction getDayOfWeek() { + return dayOfWeek; + } + + + public void setDayOfWeek(DayOfWeekRestriction dayOfWeek) { + this.dayOfWeek = dayOfWeek; + } + + public TransactionRuleRestrictions differentCurrencies(DifferentCurrenciesRestriction differentCurrencies) { this.differentCurrencies = differentCurrencies; @@ -287,6 +319,28 @@ public void setMccs(MccsRestriction mccs) { } + public TransactionRuleRestrictions merchantNames(MerchantNamesRestriction merchantNames) { + + this.merchantNames = merchantNames; + return this; + } + + /** + * Get merchantNames + * @return merchantNames + **/ + @ApiModelProperty(value = "") + + public MerchantNamesRestriction getMerchantNames() { + return merchantNames; + } + + + public void setMerchantNames(MerchantNamesRestriction merchantNames) { + this.merchantNames = merchantNames; + } + + public TransactionRuleRestrictions merchants(MerchantsRestriction merchants) { this.merchants = merchants; @@ -388,11 +442,13 @@ public boolean equals(Object o) { return Objects.equals(this.activeNetworkTokens, transactionRuleRestrictions.activeNetworkTokens) && Objects.equals(this.brandVariants, transactionRuleRestrictions.brandVariants) && Objects.equals(this.countries, transactionRuleRestrictions.countries) && + Objects.equals(this.dayOfWeek, transactionRuleRestrictions.dayOfWeek) && Objects.equals(this.differentCurrencies, transactionRuleRestrictions.differentCurrencies) && Objects.equals(this.entryModes, transactionRuleRestrictions.entryModes) && Objects.equals(this.internationalTransaction, transactionRuleRestrictions.internationalTransaction) && Objects.equals(this.matchingTransactions, transactionRuleRestrictions.matchingTransactions) && Objects.equals(this.mccs, transactionRuleRestrictions.mccs) && + Objects.equals(this.merchantNames, transactionRuleRestrictions.merchantNames) && Objects.equals(this.merchants, transactionRuleRestrictions.merchants) && Objects.equals(this.processingTypes, transactionRuleRestrictions.processingTypes) && Objects.equals(this.timeOfDay, transactionRuleRestrictions.timeOfDay) && @@ -401,7 +457,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(activeNetworkTokens, brandVariants, countries, differentCurrencies, entryModes, internationalTransaction, matchingTransactions, mccs, merchants, processingTypes, timeOfDay, totalAmount); + return Objects.hash(activeNetworkTokens, brandVariants, countries, dayOfWeek, differentCurrencies, entryModes, internationalTransaction, matchingTransactions, mccs, merchantNames, merchants, processingTypes, timeOfDay, totalAmount); } @Override @@ -411,11 +467,13 @@ public String toString() { sb.append(" activeNetworkTokens: ").append(toIndentedString(activeNetworkTokens)).append("\n"); sb.append(" brandVariants: ").append(toIndentedString(brandVariants)).append("\n"); sb.append(" countries: ").append(toIndentedString(countries)).append("\n"); + sb.append(" dayOfWeek: ").append(toIndentedString(dayOfWeek)).append("\n"); sb.append(" differentCurrencies: ").append(toIndentedString(differentCurrencies)).append("\n"); sb.append(" entryModes: ").append(toIndentedString(entryModes)).append("\n"); sb.append(" internationalTransaction: ").append(toIndentedString(internationalTransaction)).append("\n"); sb.append(" matchingTransactions: ").append(toIndentedString(matchingTransactions)).append("\n"); sb.append(" mccs: ").append(toIndentedString(mccs)).append("\n"); + sb.append(" merchantNames: ").append(toIndentedString(merchantNames)).append("\n"); sb.append(" merchants: ").append(toIndentedString(merchants)).append("\n"); sb.append(" processingTypes: ").append(toIndentedString(processingTypes)).append("\n"); sb.append(" timeOfDay: ").append(toIndentedString(timeOfDay)).append("\n"); @@ -445,11 +503,13 @@ private String toIndentedString(Object o) { openapiFields.add("activeNetworkTokens"); openapiFields.add("brandVariants"); openapiFields.add("countries"); + openapiFields.add("dayOfWeek"); openapiFields.add("differentCurrencies"); openapiFields.add("entryModes"); openapiFields.add("internationalTransaction"); openapiFields.add("matchingTransactions"); openapiFields.add("mccs"); + openapiFields.add("merchantNames"); openapiFields.add("merchants"); openapiFields.add("processingTypes"); openapiFields.add("timeOfDay"); @@ -493,6 +553,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.getAsJsonObject("countries") != null) { CountriesRestriction.validateJsonObject(jsonObj.getAsJsonObject("countries")); } + // validate the optional field `dayOfWeek` + if (jsonObj.getAsJsonObject("dayOfWeek") != null) { + DayOfWeekRestriction.validateJsonObject(jsonObj.getAsJsonObject("dayOfWeek")); + } // validate the optional field `differentCurrencies` if (jsonObj.getAsJsonObject("differentCurrencies") != null) { DifferentCurrenciesRestriction.validateJsonObject(jsonObj.getAsJsonObject("differentCurrencies")); @@ -513,6 +577,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.getAsJsonObject("mccs") != null) { MccsRestriction.validateJsonObject(jsonObj.getAsJsonObject("mccs")); } + // validate the optional field `merchantNames` + if (jsonObj.getAsJsonObject("merchantNames") != null) { + MerchantNamesRestriction.validateJsonObject(jsonObj.getAsJsonObject("merchantNames")); + } // validate the optional field `merchants` if (jsonObj.getAsJsonObject("merchants") != null) { MerchantsRestriction.validateJsonObject(jsonObj.getAsJsonObject("merchants")); diff --git a/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java new file mode 100644 index 000000000..27b1ae50f --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java @@ -0,0 +1,332 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * UKLocalAccountIdentification + */ + +public class UKLocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_SORT_CODE = "sortCode"; + @SerializedName(SERIALIZED_NAME_SORT_CODE) + private String sortCode; + + /** + * **ukLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + UKLOCAL("ukLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.UKLOCAL; + + public UKLocalAccountIdentification() { + } + + public UKLocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 8-digit bank account number, without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 8-digit bank account number, without separators or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public UKLocalAccountIdentification sortCode(String sortCode) { + + this.sortCode = sortCode; + return this; + } + + /** + * The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + * @return sortCode + **/ + @ApiModelProperty(required = true, value = "The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace.") + + public String getSortCode() { + return sortCode; + } + + + public void setSortCode(String sortCode) { + this.sortCode = sortCode; + } + + + public UKLocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **ukLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**ukLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UKLocalAccountIdentification ukLocalAccountIdentification = (UKLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, ukLocalAccountIdentification.accountNumber) && + Objects.equals(this.sortCode, ukLocalAccountIdentification.sortCode) && + Objects.equals(this.type, ukLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, sortCode, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UKLocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" sortCode: ").append(toIndentedString(sortCode)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("sortCode"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("sortCode"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UKLocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (UKLocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in UKLocalAccountIdentification is not found in the empty JSON string", UKLocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UKLocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UKLocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UKLocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // validate the optional field sortCode + if (jsonObj.get("sortCode") != null && !jsonObj.get("sortCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sortCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sortCode").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UKLocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UKLocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UKLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UKLocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UKLocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UKLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of UKLocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to UKLocalAccountIdentification + */ + public static UKLocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UKLocalAccountIdentification.class); + } + + /** + * Convert an instance of UKLocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java new file mode 100644 index 000000000..91798841a --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java @@ -0,0 +1,415 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * USLocalAccountIdentification + */ + +public class USLocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + /** + * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + */ + @JsonAdapter(AccountTypeEnum.Adapter.class) + public enum AccountTypeEnum { + CHECKING("checking"), + + SAVINGS("savings"); + + private String value; + + AccountTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AccountTypeEnum fromValue(String value) { + for (AccountTypeEnum b : AccountTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AccountTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AccountTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AccountTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ACCOUNT_TYPE = "accountType"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_TYPE) + private AccountTypeEnum accountType = AccountTypeEnum.CHECKING; + + public static final String SERIALIZED_NAME_ROUTING_NUMBER = "routingNumber"; + @SerializedName(SERIALIZED_NAME_ROUTING_NUMBER) + private String routingNumber; + + /** + * **usLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + USLOCAL("usLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.USLOCAL; + + public USLocalAccountIdentification() { + } + + public USLocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The bank account number, without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The bank account number, without separators or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public USLocalAccountIdentification accountType(AccountTypeEnum accountType) { + + this.accountType = accountType; + return this; + } + + /** + * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * @return accountType + **/ + @ApiModelProperty(value = "The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**.") + + public AccountTypeEnum getAccountType() { + return accountType; + } + + + public void setAccountType(AccountTypeEnum accountType) { + this.accountType = accountType; + } + + + public USLocalAccountIdentification routingNumber(String routingNumber) { + + this.routingNumber = routingNumber; + return this; + } + + /** + * The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + * @return routingNumber + **/ + @ApiModelProperty(required = true, value = "The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace.") + + public String getRoutingNumber() { + return routingNumber; + } + + + public void setRoutingNumber(String routingNumber) { + this.routingNumber = routingNumber; + } + + + public USLocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **usLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**usLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + USLocalAccountIdentification usLocalAccountIdentification = (USLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, usLocalAccountIdentification.accountNumber) && + Objects.equals(this.accountType, usLocalAccountIdentification.accountType) && + Objects.equals(this.routingNumber, usLocalAccountIdentification.routingNumber) && + Objects.equals(this.type, usLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, accountType, routingNumber, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class USLocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); + sb.append(" routingNumber: ").append(toIndentedString(routingNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("accountType"); + openapiFields.add("routingNumber"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("routingNumber"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to USLocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (USLocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in USLocalAccountIdentification is not found in the empty JSON string", USLocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!USLocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `USLocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : USLocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // ensure the field accountType can be parsed to an enum value + if (jsonObj.get("accountType") != null) { + if(!jsonObj.get("accountType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountType").toString())); + } + AccountTypeEnum.fromValue(jsonObj.get("accountType").getAsString()); + } + // validate the optional field routingNumber + if (jsonObj.get("routingNumber") != null && !jsonObj.get("routingNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `routingNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("routingNumber").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!USLocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'USLocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(USLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, USLocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public USLocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of USLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of USLocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to USLocalAccountIdentification + */ + public static USLocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, USLocalAccountIdentification.class); + } + + /** + * Convert an instance of USLocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java b/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java new file mode 100644 index 000000000..61c1491c1 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java @@ -0,0 +1,750 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balanceplatform.Card; +import com.adyen.model.balanceplatform.PaymentInstrumentBankAccount; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * UpdatePaymentInstrument + */ + +public class UpdatePaymentInstrument { + public static final String SERIALIZED_NAME_BALANCE_ACCOUNT_ID = "balanceAccountId"; + @SerializedName(SERIALIZED_NAME_BALANCE_ACCOUNT_ID) + private String balanceAccountId; + + public static final String SERIALIZED_NAME_BANK_ACCOUNT = "bankAccount"; + @SerializedName(SERIALIZED_NAME_BANK_ACCOUNT) + private PaymentInstrumentBankAccount bankAccount; + + public static final String SERIALIZED_NAME_CARD = "card"; + @SerializedName(SERIALIZED_NAME_CARD) + private Card card; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_ISSUING_COUNTRY_CODE = "issuingCountryCode"; + @SerializedName(SERIALIZED_NAME_ISSUING_COUNTRY_CODE) + private String issuingCountryCode; + + public static final String SERIALIZED_NAME_PAYMENT_INSTRUMENT_GROUP_ID = "paymentInstrumentGroupId"; + @SerializedName(SERIALIZED_NAME_PAYMENT_INSTRUMENT_GROUP_ID) + private String paymentInstrumentGroupId; + + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; + + /** + * The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACTIVE("active"), + + CLOSED("closed"), + + INACTIVE("inactive"), + + SUSPENDED("suspended"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_STATUS_COMMENT = "statusComment"; + @SerializedName(SERIALIZED_NAME_STATUS_COMMENT) + private String statusComment; + + /** + * The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + */ + @JsonAdapter(StatusReasonEnum.Adapter.class) + public enum StatusReasonEnum { + ACCOUNTCLOSURE("accountClosure"), + + DAMAGED("damaged"), + + ENDOFLIFE("endOfLife"), + + EXPIRED("expired"), + + LOST("lost"), + + OTHER("other"), + + STOLEN("stolen"), + + SUSPECTEDFRAUD("suspectedFraud"); + + private String value; + + StatusReasonEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusReasonEnum fromValue(String value) { + for (StatusReasonEnum b : StatusReasonEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusReasonEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusReasonEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusReasonEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS_REASON = "statusReason"; + @SerializedName(SERIALIZED_NAME_STATUS_REASON) + private StatusReasonEnum statusReason; + + /** + * Type of payment instrument. Possible value: **card**, **bankAccount**. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BANKACCOUNT("bankAccount"), + + CARD("card"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public UpdatePaymentInstrument() { + } + + public UpdatePaymentInstrument balanceAccountId(String balanceAccountId) { + + this.balanceAccountId = balanceAccountId; + return this; + } + + /** + * The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. + * @return balanceAccountId + **/ + @ApiModelProperty(required = true, value = "The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument.") + + public String getBalanceAccountId() { + return balanceAccountId; + } + + + public void setBalanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + } + + + public UpdatePaymentInstrument bankAccount(PaymentInstrumentBankAccount bankAccount) { + + this.bankAccount = bankAccount; + return this; + } + + /** + * Get bankAccount + * @return bankAccount + **/ + @ApiModelProperty(value = "") + + public PaymentInstrumentBankAccount getBankAccount() { + return bankAccount; + } + + + public void setBankAccount(PaymentInstrumentBankAccount bankAccount) { + this.bankAccount = bankAccount; + } + + + public UpdatePaymentInstrument card(Card card) { + + this.card = card; + return this; + } + + /** + * Get card + * @return card + **/ + @ApiModelProperty(value = "") + + public Card getCard() { + return card; + } + + + public void setCard(Card card) { + this.card = card; + } + + + public UpdatePaymentInstrument description(String description) { + + this.description = description; + return this; + } + + /** + * Your description for the payment instrument, maximum 300 characters. + * @return description + **/ + @ApiModelProperty(value = "Your description for the payment instrument, maximum 300 characters.") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public UpdatePaymentInstrument id(String id) { + + this.id = id; + return this; + } + + /** + * The unique identifier of the payment instrument. + * @return id + **/ + @ApiModelProperty(required = true, value = "The unique identifier of the payment instrument.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public UpdatePaymentInstrument issuingCountryCode(String issuingCountryCode) { + + this.issuingCountryCode = issuingCountryCode; + return this; + } + + /** + * The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment instrument is issued. For example, **NL** or **US**. + * @return issuingCountryCode + **/ + @ApiModelProperty(required = true, value = "The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment instrument is issued. For example, **NL** or **US**.") + + public String getIssuingCountryCode() { + return issuingCountryCode; + } + + + public void setIssuingCountryCode(String issuingCountryCode) { + this.issuingCountryCode = issuingCountryCode; + } + + + public UpdatePaymentInstrument paymentInstrumentGroupId(String paymentInstrumentGroupId) { + + this.paymentInstrumentGroupId = paymentInstrumentGroupId; + return this; + } + + /** + * The unique identifier of the [payment instrument group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) to which the payment instrument belongs. + * @return paymentInstrumentGroupId + **/ + @ApiModelProperty(value = "The unique identifier of the [payment instrument group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) to which the payment instrument belongs.") + + public String getPaymentInstrumentGroupId() { + return paymentInstrumentGroupId; + } + + + public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { + this.paymentInstrumentGroupId = paymentInstrumentGroupId; + } + + + public UpdatePaymentInstrument reference(String reference) { + + this.reference = reference; + return this; + } + + /** + * Your reference for the payment instrument, maximum 150 characters. + * @return reference + **/ + @ApiModelProperty(value = "Your reference for the payment instrument, maximum 150 characters.") + + public String getReference() { + return reference; + } + + + public void setReference(String reference) { + this.reference = reference; + } + + + public UpdatePaymentInstrument status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + * @return status + **/ + @ApiModelProperty(value = "The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions for cards based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. ") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public UpdatePaymentInstrument statusComment(String statusComment) { + + this.statusComment = statusComment; + return this; + } + + /** + * Comment for the status of the payment instrument. Required if `statusReason` is **other**. + * @return statusComment + **/ + @ApiModelProperty(value = "Comment for the status of the payment instrument. Required if `statusReason` is **other**.") + + public String getStatusComment() { + return statusComment; + } + + + public void setStatusComment(String statusComment) { + this.statusComment = statusComment; + } + + + public UpdatePaymentInstrument statusReason(StatusReasonEnum statusReason) { + + this.statusReason = statusReason; + return this; + } + + /** + * The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + * @return statusReason + **/ + @ApiModelProperty(value = "The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change.") + + public StatusReasonEnum getStatusReason() { + return statusReason; + } + + + public void setStatusReason(StatusReasonEnum statusReason) { + this.statusReason = statusReason; + } + + + public UpdatePaymentInstrument type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of payment instrument. Possible value: **card**, **bankAccount**. + * @return type + **/ + @ApiModelProperty(required = true, value = "Type of payment instrument. Possible value: **card**, **bankAccount**. ") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePaymentInstrument updatePaymentInstrument = (UpdatePaymentInstrument) o; + return Objects.equals(this.balanceAccountId, updatePaymentInstrument.balanceAccountId) && + Objects.equals(this.bankAccount, updatePaymentInstrument.bankAccount) && + Objects.equals(this.card, updatePaymentInstrument.card) && + Objects.equals(this.description, updatePaymentInstrument.description) && + Objects.equals(this.id, updatePaymentInstrument.id) && + Objects.equals(this.issuingCountryCode, updatePaymentInstrument.issuingCountryCode) && + Objects.equals(this.paymentInstrumentGroupId, updatePaymentInstrument.paymentInstrumentGroupId) && + Objects.equals(this.reference, updatePaymentInstrument.reference) && + Objects.equals(this.status, updatePaymentInstrument.status) && + Objects.equals(this.statusComment, updatePaymentInstrument.statusComment) && + Objects.equals(this.statusReason, updatePaymentInstrument.statusReason) && + Objects.equals(this.type, updatePaymentInstrument.type); + } + + @Override + public int hashCode() { + return Objects.hash(balanceAccountId, bankAccount, card, description, id, issuingCountryCode, paymentInstrumentGroupId, reference, status, statusComment, statusReason, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdatePaymentInstrument {\n"); + sb.append(" balanceAccountId: ").append(toIndentedString(balanceAccountId)).append("\n"); + sb.append(" bankAccount: ").append(toIndentedString(bankAccount)).append("\n"); + sb.append(" card: ").append(toIndentedString(card)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" issuingCountryCode: ").append(toIndentedString(issuingCountryCode)).append("\n"); + sb.append(" paymentInstrumentGroupId: ").append(toIndentedString(paymentInstrumentGroupId)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" statusComment: ").append(toIndentedString(statusComment)).append("\n"); + sb.append(" statusReason: ").append(toIndentedString(statusReason)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("balanceAccountId"); + openapiFields.add("bankAccount"); + openapiFields.add("card"); + openapiFields.add("description"); + openapiFields.add("id"); + openapiFields.add("issuingCountryCode"); + openapiFields.add("paymentInstrumentGroupId"); + openapiFields.add("reference"); + openapiFields.add("status"); + openapiFields.add("statusComment"); + openapiFields.add("statusReason"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("balanceAccountId"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("issuingCountryCode"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UpdatePaymentInstrument + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (UpdatePaymentInstrument.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdatePaymentInstrument is not found in the empty JSON string", UpdatePaymentInstrument.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UpdatePaymentInstrument.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdatePaymentInstrument` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdatePaymentInstrument.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field balanceAccountId + if (jsonObj.get("balanceAccountId") != null && !jsonObj.get("balanceAccountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); + } + // validate the optional field `bankAccount` + if (jsonObj.getAsJsonObject("bankAccount") != null) { + PaymentInstrumentBankAccount.validateJsonObject(jsonObj.getAsJsonObject("bankAccount")); + } + // validate the optional field `card` + if (jsonObj.getAsJsonObject("card") != null) { + Card.validateJsonObject(jsonObj.getAsJsonObject("card")); + } + // validate the optional field description + if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field issuingCountryCode + if (jsonObj.get("issuingCountryCode") != null && !jsonObj.get("issuingCountryCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuingCountryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuingCountryCode").toString())); + } + // validate the optional field paymentInstrumentGroupId + if (jsonObj.get("paymentInstrumentGroupId") != null && !jsonObj.get("paymentInstrumentGroupId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `paymentInstrumentGroupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentInstrumentGroupId").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + // ensure the field status can be parsed to an enum value + if (jsonObj.get("status") != null) { + if(!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + StatusEnum.fromValue(jsonObj.get("status").getAsString()); + } + // validate the optional field statusComment + if (jsonObj.get("statusComment") != null && !jsonObj.get("statusComment").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `statusComment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("statusComment").toString())); + } + // ensure the field statusReason can be parsed to an enum value + if (jsonObj.get("statusReason") != null) { + if(!jsonObj.get("statusReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `statusReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("statusReason").toString())); + } + StatusReasonEnum.fromValue(jsonObj.get("statusReason").getAsString()); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UpdatePaymentInstrument.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdatePaymentInstrument' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdatePaymentInstrument.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UpdatePaymentInstrument value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UpdatePaymentInstrument read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdatePaymentInstrument given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdatePaymentInstrument + * @throws IOException if the JSON string is invalid with respect to UpdatePaymentInstrument + */ + public static UpdatePaymentInstrument fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdatePaymentInstrument.class); + } + + /** + * Convert an instance of UpdatePaymentInstrument to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java b/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java new file mode 100644 index 000000000..9fea30a3a --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java @@ -0,0 +1,384 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * VerificationDeadline + */ + +public class VerificationDeadline { + /** + * Gets or Sets capabilities + */ + @JsonAdapter(CapabilitiesEnum.Adapter.class) + public enum CapabilitiesEnum { + ACCEPTEXTERNALFUNDING("acceptExternalFunding"), + + ACCEPTPSPFUNDING("acceptPspFunding"), + + ACCEPTTRANSACTIONINRESTRICTEDCOUNTRIES("acceptTransactionInRestrictedCountries"), + + ACCEPTTRANSACTIONINRESTRICTEDCOUNTRIESCOMMERCIAL("acceptTransactionInRestrictedCountriesCommercial"), + + ACCEPTTRANSACTIONINRESTRICTEDCOUNTRIESCONSUMER("acceptTransactionInRestrictedCountriesConsumer"), + + ACCEPTTRANSACTIONINRESTRICTEDINDUSTRIES("acceptTransactionInRestrictedIndustries"), + + ACCEPTTRANSACTIONINRESTRICTEDINDUSTRIESCOMMERCIAL("acceptTransactionInRestrictedIndustriesCommercial"), + + ACCEPTTRANSACTIONINRESTRICTEDINDUSTRIESCONSUMER("acceptTransactionInRestrictedIndustriesConsumer"), + + ACQUIRING("acquiring"), + + ATMWITHDRAWAL("atmWithdrawal"), + + ATMWITHDRAWALCOMMERCIAL("atmWithdrawalCommercial"), + + ATMWITHDRAWALCONSUMER("atmWithdrawalConsumer"), + + ATMWITHDRAWALINRESTRICTEDCOUNTRIES("atmWithdrawalInRestrictedCountries"), + + ATMWITHDRAWALINRESTRICTEDCOUNTRIESCOMMERCIAL("atmWithdrawalInRestrictedCountriesCommercial"), + + ATMWITHDRAWALINRESTRICTEDCOUNTRIESCONSUMER("atmWithdrawalInRestrictedCountriesConsumer"), + + AUTHORISEDPAYMENTINSTRUMENTUSER("authorisedPaymentInstrumentUser"), + + GETGRANTOFFERS("getGrantOffers"), + + ISSUEBANKACCOUNT("issueBankAccount"), + + ISSUECARD("issueCard"), + + ISSUECARDCOMMERCIAL("issueCardCommercial"), + + ISSUECARDCONSUMER("issueCardConsumer"), + + LOCALACCEPTANCE("localAcceptance"), + + PAYOUT("payout"), + + PAYOUTTOTRANSFERINSTRUMENT("payoutToTransferInstrument"), + + PROCESSING("processing"), + + RECEIVEFROMBALANCEACCOUNT("receiveFromBalanceAccount"), + + RECEIVEFROMPLATFORMPAYMENTS("receiveFromPlatformPayments"), + + RECEIVEFROMTHIRDPARTY("receiveFromThirdParty"), + + RECEIVEFROMTRANSFERINSTRUMENT("receiveFromTransferInstrument"), + + RECEIVEGRANTS("receiveGrants"), + + RECEIVEPAYMENTS("receivePayments"), + + SENDTOBALANCEACCOUNT("sendToBalanceAccount"), + + SENDTOTHIRDPARTY("sendToThirdParty"), + + SENDTOTRANSFERINSTRUMENT("sendToTransferInstrument"), + + THIRDPARTYFUNDING("thirdPartyFunding"), + + USECARD("useCard"), + + USECARDCOMMERCIAL("useCardCommercial"), + + USECARDCONSUMER("useCardConsumer"), + + USECARDINRESTRICTEDCOUNTRIES("useCardInRestrictedCountries"), + + USECARDINRESTRICTEDCOUNTRIESCOMMERCIAL("useCardInRestrictedCountriesCommercial"), + + USECARDINRESTRICTEDCOUNTRIESCONSUMER("useCardInRestrictedCountriesConsumer"), + + USECARDINRESTRICTEDINDUSTRIES("useCardInRestrictedIndustries"), + + USECARDINRESTRICTEDINDUSTRIESCOMMERCIAL("useCardInRestrictedIndustriesCommercial"), + + USECARDINRESTRICTEDINDUSTRIESCONSUMER("useCardInRestrictedIndustriesConsumer"), + + WITHDRAWFROMATM("withdrawFromAtm"), + + WITHDRAWFROMATMCOMMERCIAL("withdrawFromAtmCommercial"), + + WITHDRAWFROMATMCONSUMER("withdrawFromAtmConsumer"), + + WITHDRAWFROMATMINRESTRICTEDCOUNTRIES("withdrawFromAtmInRestrictedCountries"), + + WITHDRAWFROMATMINRESTRICTEDCOUNTRIESCOMMERCIAL("withdrawFromAtmInRestrictedCountriesCommercial"), + + WITHDRAWFROMATMINRESTRICTEDCOUNTRIESCONSUMER("withdrawFromAtmInRestrictedCountriesConsumer"); + + private String value; + + CapabilitiesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CapabilitiesEnum fromValue(String value) { + for (CapabilitiesEnum b : CapabilitiesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final CapabilitiesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CapabilitiesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CapabilitiesEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; + @SerializedName(SERIALIZED_NAME_CAPABILITIES) + private List capabilities = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EXPIRES_AT = "expiresAt"; + @SerializedName(SERIALIZED_NAME_EXPIRES_AT) + private OffsetDateTime expiresAt; + + public VerificationDeadline() { + } + + + public VerificationDeadline( + List capabilities, + OffsetDateTime expiresAt + ) { + this(); + this.capabilities = capabilities; + this.expiresAt = expiresAt; + } + + /** + * The names of the capabilities to be disallowed. + * @return capabilities + **/ + @ApiModelProperty(required = true, value = "The names of the capabilities to be disallowed.") + + public List getCapabilities() { + return capabilities; + } + + + + + /** + * The date that verification is due by before capabilities are disallowed. + * @return expiresAt + **/ + @ApiModelProperty(required = true, value = "The date that verification is due by before capabilities are disallowed.") + + public OffsetDateTime getExpiresAt() { + return expiresAt; + } + + + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerificationDeadline verificationDeadline = (VerificationDeadline) o; + return Objects.equals(this.capabilities, verificationDeadline.capabilities) && + Objects.equals(this.expiresAt, verificationDeadline.expiresAt); + } + + @Override + public int hashCode() { + return Objects.hash(capabilities, expiresAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VerificationDeadline {\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("capabilities"); + openapiFields.add("expiresAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("capabilities"); + openapiRequiredFields.add("expiresAt"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to VerificationDeadline + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (VerificationDeadline.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in VerificationDeadline is not found in the empty JSON string", VerificationDeadline.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!VerificationDeadline.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VerificationDeadline` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : VerificationDeadline.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("capabilities") != null && !jsonObj.get("capabilities").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `capabilities` to be an array in the JSON string but got `%s`", jsonObj.get("capabilities").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VerificationDeadline.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VerificationDeadline' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VerificationDeadline.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, VerificationDeadline value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VerificationDeadline read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VerificationDeadline given an JSON string + * + * @param jsonString JSON string + * @return An instance of VerificationDeadline + * @throws IOException if the JSON string is invalid with respect to VerificationDeadline + */ + public static VerificationDeadline fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VerificationDeadline.class); + } + + /** + * Convert an instance of VerificationDeadline to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/VerificationError.java b/src/main/java/com/adyen/model/balanceplatform/VerificationError.java deleted file mode 100644 index 3347a32c5..000000000 --- a/src/main/java/com/adyen/model/balanceplatform/VerificationError.java +++ /dev/null @@ -1,428 +0,0 @@ -/* - * Configuration API - * - * The version of the OpenAPI document: 2 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.model.balanceplatform; - -import java.util.Objects; -import java.util.Arrays; -import com.adyen.model.balanceplatform.RemediatingAction; -import com.adyen.model.balanceplatform.VerificationErrorRecursive; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import com.adyen.model.balanceplatform.JSON; - -/** - * VerificationError - */ - -public class VerificationError { - public static final String SERIALIZED_NAME_CODE = "code"; - @SerializedName(SERIALIZED_NAME_CODE) - private String code; - - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; - - public static final String SERIALIZED_NAME_REMEDIATING_ACTIONS = "remediatingActions"; - @SerializedName(SERIALIZED_NAME_REMEDIATING_ACTIONS) - private List remediatingActions = null; - - public static final String SERIALIZED_NAME_SUB_ERRORS = "subErrors"; - @SerializedName(SERIALIZED_NAME_SUB_ERRORS) - private List subErrors = null; - - /** - * The type of error. Possible values: **invalidInput**, **dataMissing**. - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - DATAMISSING("dataMissing"), - - INVALIDINPUT("invalidInput"), - - PENDINGSTATUS("pendingStatus"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public VerificationError() { - } - - public VerificationError code(String code) { - - this.code = code; - return this; - } - - /** - * The verification error code. - * @return code - **/ - @ApiModelProperty(value = "The verification error code.") - - public String getCode() { - return code; - } - - - public void setCode(String code) { - this.code = code; - } - - - public VerificationError message(String message) { - - this.message = message; - return this; - } - - /** - * A description of the error. - * @return message - **/ - @ApiModelProperty(value = "A description of the error.") - - public String getMessage() { - return message; - } - - - public void setMessage(String message) { - this.message = message; - } - - - public VerificationError remediatingActions(List remediatingActions) { - - this.remediatingActions = remediatingActions; - return this; - } - - public VerificationError addRemediatingActionsItem(RemediatingAction remediatingActionsItem) { - if (this.remediatingActions == null) { - this.remediatingActions = new ArrayList<>(); - } - this.remediatingActions.add(remediatingActionsItem); - return this; - } - - /** - * Contains the actions that you can take to resolve the verification error. - * @return remediatingActions - **/ - @ApiModelProperty(value = "Contains the actions that you can take to resolve the verification error.") - - public List getRemediatingActions() { - return remediatingActions; - } - - - public void setRemediatingActions(List remediatingActions) { - this.remediatingActions = remediatingActions; - } - - - public VerificationError subErrors(List subErrors) { - - this.subErrors = subErrors; - return this; - } - - public VerificationError addSubErrorsItem(VerificationErrorRecursive subErrorsItem) { - if (this.subErrors == null) { - this.subErrors = new ArrayList<>(); - } - this.subErrors.add(subErrorsItem); - return this; - } - - /** - * Contains more granular information about the verification error. - * @return subErrors - **/ - @ApiModelProperty(value = "Contains more granular information about the verification error.") - - public List getSubErrors() { - return subErrors; - } - - - public void setSubErrors(List subErrors) { - this.subErrors = subErrors; - } - - - public VerificationError type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * The type of error. Possible values: **invalidInput**, **dataMissing**. - * @return type - **/ - @ApiModelProperty(value = "The type of error. Possible values: **invalidInput**, **dataMissing**.") - - public TypeEnum getType() { - return type; - } - - - public void setType(TypeEnum type) { - this.type = type; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - VerificationError verificationError = (VerificationError) o; - return Objects.equals(this.code, verificationError.code) && - Objects.equals(this.message, verificationError.message) && - Objects.equals(this.remediatingActions, verificationError.remediatingActions) && - Objects.equals(this.subErrors, verificationError.subErrors) && - Objects.equals(this.type, verificationError.type); - } - - @Override - public int hashCode() { - return Objects.hash(code, message, remediatingActions, subErrors, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class VerificationError {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" remediatingActions: ").append(toIndentedString(remediatingActions)).append("\n"); - sb.append(" subErrors: ").append(toIndentedString(subErrors)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("code"); - openapiFields.add("message"); - openapiFields.add("remediatingActions"); - openapiFields.add("subErrors"); - openapiFields.add("type"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to VerificationError - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (VerificationError.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in VerificationError is not found in the empty JSON string", VerificationError.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!VerificationError.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VerificationError` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field code - if (jsonObj.get("code") != null && !jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); - } - // validate the optional field message - if (jsonObj.get("message") != null && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); - } - JsonArray jsonArrayremediatingActions = jsonObj.getAsJsonArray("remediatingActions"); - if (jsonArrayremediatingActions != null) { - // ensure the json data is an array - if (!jsonObj.get("remediatingActions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `remediatingActions` to be an array in the JSON string but got `%s`", jsonObj.get("remediatingActions").toString())); - } - - // validate the optional field `remediatingActions` (array) - for (int i = 0; i < jsonArrayremediatingActions.size(); i++) { - RemediatingAction.validateJsonObject(jsonArrayremediatingActions.get(i).getAsJsonObject()); - }; - } - JsonArray jsonArraysubErrors = jsonObj.getAsJsonArray("subErrors"); - if (jsonArraysubErrors != null) { - // ensure the json data is an array - if (!jsonObj.get("subErrors").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `subErrors` to be an array in the JSON string but got `%s`", jsonObj.get("subErrors").toString())); - } - - // validate the optional field `subErrors` (array) - for (int i = 0; i < jsonArraysubErrors.size(); i++) { - VerificationErrorRecursive.validateJsonObject(jsonArraysubErrors.get(i).getAsJsonObject()); - }; - } - // ensure the field type can be parsed to an enum value - if (jsonObj.get("type") != null) { - if(!jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); - } - TypeEnum.fromValue(jsonObj.get("type").getAsString()); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!VerificationError.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'VerificationError' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(VerificationError.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, VerificationError value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public VerificationError read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of VerificationError given an JSON string - * - * @param jsonString JSON string - * @return An instance of VerificationError - * @throws IOException if the JSON string is invalid with respect to VerificationError - */ - public static VerificationError fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, VerificationError.class); - } - - /** - * Convert an instance of VerificationError to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java index b038044bd..b7cbf98ec 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java @@ -77,10 +77,14 @@ public enum TypeEnum { ADYENCAPITAL("adyenCapital"), + ADYENCARD("adyenCard"), + ADYENFORPLATFORMSADVANCED("adyenForPlatformsAdvanced"), ADYENFORPLATFORMSMANAGE("adyenForPlatformsManage"), + ADYENFRANCHISEE("adyenFranchisee"), + ADYENISSUING("adyenIssuing"); private String value; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CalculateTermsOfServiceStatusResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/CalculateTermsOfServiceStatusResponse.java index 15993c6dd..b7b346cd7 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CalculateTermsOfServiceStatusResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CalculateTermsOfServiceStatusResponse.java @@ -59,10 +59,14 @@ public enum TermsOfServiceTypesEnum { ADYENCAPITAL("adyenCapital"), + ADYENCARD("adyenCard"), + ADYENFORPLATFORMSADVANCED("adyenForPlatformsAdvanced"), ADYENFORPLATFORMSMANAGE("adyenForPlatformsManage"), + ADYENFRANCHISEE("adyenFranchisee"), + ADYENISSUING("adyenIssuing"); private String value; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java index 41f4fe15f..4057e0dc8 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java @@ -23,6 +23,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -49,6 +51,10 @@ */ public class CapabilityProblemEntity { + public static final String SERIALIZED_NAME_DOCUMENTS = "documents"; + @SerializedName(SERIALIZED_NAME_DOCUMENTS) + private List documents = null; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private String id; @@ -113,6 +119,36 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { public CapabilityProblemEntity() { } + public CapabilityProblemEntity documents(List documents) { + + this.documents = documents; + return this; + } + + public CapabilityProblemEntity addDocumentsItem(String documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + this.documents.add(documentsItem); + return this; + } + + /** + * Get documents + * @return documents + **/ + @ApiModelProperty(value = "") + + public List getDocuments() { + return documents; + } + + + public void setDocuments(List documents) { + this.documents = documents; + } + + public CapabilityProblemEntity id(String id) { this.id = id; @@ -189,20 +225,22 @@ public boolean equals(Object o) { return false; } CapabilityProblemEntity capabilityProblemEntity = (CapabilityProblemEntity) o; - return Objects.equals(this.id, capabilityProblemEntity.id) && + return Objects.equals(this.documents, capabilityProblemEntity.documents) && + Objects.equals(this.id, capabilityProblemEntity.id) && Objects.equals(this.owner, capabilityProblemEntity.owner) && Objects.equals(this.type, capabilityProblemEntity.type); } @Override public int hashCode() { - return Objects.hash(id, owner, type); + return Objects.hash(documents, id, owner, type); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CapabilityProblemEntity {\n"); + sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" owner: ").append(toIndentedString(owner)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); @@ -228,6 +266,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("documents"); openapiFields.add("id"); openapiFields.add("owner"); openapiFields.add("type"); @@ -258,6 +297,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CapabilityProblemEntity` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } + // ensure the json data is an array + if (jsonObj.get("documents") != null && !jsonObj.get("documents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `documents` to be an array in the JSON string but got `%s`", jsonObj.get("documents").toString())); + } // validate the optional field id if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java index 93dc3c4cc..8b593090d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java @@ -22,6 +22,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -48,6 +50,10 @@ */ public class CapabilityProblemEntityRecursive { + public static final String SERIALIZED_NAME_DOCUMENTS = "documents"; + @SerializedName(SERIALIZED_NAME_DOCUMENTS) + private List documents = null; + public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private String id; @@ -108,6 +114,36 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { public CapabilityProblemEntityRecursive() { } + public CapabilityProblemEntityRecursive documents(List documents) { + + this.documents = documents; + return this; + } + + public CapabilityProblemEntityRecursive addDocumentsItem(String documentsItem) { + if (this.documents == null) { + this.documents = new ArrayList<>(); + } + this.documents.add(documentsItem); + return this; + } + + /** + * Get documents + * @return documents + **/ + @ApiModelProperty(value = "") + + public List getDocuments() { + return documents; + } + + + public void setDocuments(List documents) { + this.documents = documents; + } + + public CapabilityProblemEntityRecursive id(String id) { this.id = id; @@ -162,19 +198,21 @@ public boolean equals(Object o) { return false; } CapabilityProblemEntityRecursive capabilityProblemEntityRecursive = (CapabilityProblemEntityRecursive) o; - return Objects.equals(this.id, capabilityProblemEntityRecursive.id) && + return Objects.equals(this.documents, capabilityProblemEntityRecursive.documents) && + Objects.equals(this.id, capabilityProblemEntityRecursive.id) && Objects.equals(this.type, capabilityProblemEntityRecursive.type); } @Override public int hashCode() { - return Objects.hash(id, type); + return Objects.hash(documents, id, type); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CapabilityProblemEntityRecursive {\n"); + sb.append(" documents: ").append(toIndentedString(documents)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); @@ -199,6 +237,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("documents"); openapiFields.add("id"); openapiFields.add("type"); @@ -228,6 +267,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CapabilityProblemEntityRecursive` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } + // ensure the json data is an array + if (jsonObj.get("documents") != null && !jsonObj.get("documents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `documents` to be an array in the JSON string but got `%s`", jsonObj.get("documents").toString())); + } // validate the optional field id if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Document.java b/src/main/java/com/adyen/model/legalentitymanagement/Document.java index 1a81853da..5dba8f503 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Document.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Document.java @@ -323,7 +323,7 @@ public void setFileName(String fileName) { * The unique identifier of the document. * @return id **/ - @ApiModelProperty(required = true, value = "The unique identifier of the document.") + @ApiModelProperty(value = "The unique identifier of the document.") public String getId() { return id; @@ -546,7 +546,6 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("attachments"); openapiRequiredFields.add("description"); - openapiRequiredFields.add("id"); openapiRequiredFields.add("owner"); openapiRequiredFields.add("type"); } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java index f821dda89..503d04beb 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java @@ -61,10 +61,14 @@ public enum TypeEnum { ADYENCAPITAL("adyenCapital"), + ADYENCARD("adyenCard"), + ADYENFORPLATFORMSADVANCED("adyenForPlatformsAdvanced"), ADYENFORPLATFORMSMANAGE("adyenForPlatformsManage"), + ADYENFRANCHISEE("adyenFranchisee"), + ADYENISSUING("adyenIssuing"); private String value; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java index b93db2e0d..72d639b3a 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java @@ -73,10 +73,14 @@ public enum TypeEnum { ADYENCAPITAL("adyenCapital"), + ADYENCARD("adyenCard"), + ADYENFORPLATFORMSADVANCED("adyenForPlatformsAdvanced"), ADYENFORPLATFORMSMANAGE("adyenForPlatformsManage"), + ADYENFRANCHISEE("adyenFranchisee"), + ADYENISSUING("adyenIssuing"); private String value; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java b/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java index 407481d2d..fbca93d5b 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java @@ -163,10 +163,10 @@ public SourceOfFunds description(String description) { } /** - * Text describing the source of funds. For example, for `type` **business**, provide a description of the business. Required when `adyenProcessedFunds` is **false**. + * Text describing the source of funds. For example, for `type` **business**, provide a description of where the business transactions come from, such as payments through bank transfer. Required when `adyenProcessedFunds` is **false**. * @return description **/ - @ApiModelProperty(value = "Text describing the source of funds. For example, for `type` **business**, provide a description of the business. Required when `adyenProcessedFunds` is **false**.") + @ApiModelProperty(value = "Text describing the source of funds. For example, for `type` **business**, provide a description of where the business transactions come from, such as payments through bank transfer. Required when `adyenProcessedFunds` is **false**.") public String getDescription() { return description; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java index bd9b6f2b1..31f101446 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java @@ -74,10 +74,14 @@ public enum TypeEnum { ADYENCAPITAL("adyenCapital"), + ADYENCARD("adyenCard"), + ADYENFORPLATFORMSADVANCED("adyenForPlatformsAdvanced"), ADYENFORPLATFORMSMANAGE("adyenForPlatformsManage"), + ADYENFRANCHISEE("adyenFranchisee"), + ADYENISSUING("adyenIssuing"); private String value; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java index daebbfd85..59e39a8f6 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java @@ -56,6 +56,10 @@ public class TransferInstrumentReference { @SerializedName(SERIALIZED_NAME_ID) private String id; + public static final String SERIALIZED_NAME_REAL_LAST_FOUR = "realLastFour"; + @SerializedName(SERIALIZED_NAME_REAL_LAST_FOUR) + private String realLastFour; + public TransferInstrumentReference() { } @@ -103,6 +107,28 @@ public void setId(String id) { } + public TransferInstrumentReference realLastFour(String realLastFour) { + + this.realLastFour = realLastFour; + return this; + } + + /** + * Four last digits of the bank account number. + * @return realLastFour + **/ + @ApiModelProperty(value = "Four last digits of the bank account number.") + + public String getRealLastFour() { + return realLastFour; + } + + + public void setRealLastFour(String realLastFour) { + this.realLastFour = realLastFour; + } + + @Override public boolean equals(Object o) { @@ -114,12 +140,13 @@ public boolean equals(Object o) { } TransferInstrumentReference transferInstrumentReference = (TransferInstrumentReference) o; return Objects.equals(this.accountIdentifier, transferInstrumentReference.accountIdentifier) && - Objects.equals(this.id, transferInstrumentReference.id); + Objects.equals(this.id, transferInstrumentReference.id) && + Objects.equals(this.realLastFour, transferInstrumentReference.realLastFour); } @Override public int hashCode() { - return Objects.hash(accountIdentifier, id); + return Objects.hash(accountIdentifier, id, realLastFour); } @Override @@ -128,6 +155,7 @@ public String toString() { sb.append("class TransferInstrumentReference {\n"); sb.append(" accountIdentifier: ").append(toIndentedString(accountIdentifier)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" realLastFour: ").append(toIndentedString(realLastFour)).append("\n"); sb.append("}"); return sb.toString(); } @@ -152,6 +180,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("accountIdentifier"); openapiFields.add("id"); + openapiFields.add("realLastFour"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -196,6 +225,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } + // validate the optional field realLastFour + if (jsonObj.get("realLastFour") != null && !jsonObj.get("realLastFour").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `realLastFour` to be a primitive type in the JSON string but got `%s`", jsonObj.get("realLastFour").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/adyen/model/management/CompanyUser.java b/src/main/java/com/adyen/model/management/CompanyUser.java index 05576ee82..d8333789f 100644 --- a/src/main/java/com/adyen/model/management/CompanyUser.java +++ b/src/main/java/com/adyen/model/management/CompanyUser.java @@ -68,6 +68,10 @@ public class CompanyUser { @SerializedName(SERIALIZED_NAME_ASSOCIATED_MERCHANT_ACCOUNTS) private List associatedMerchantAccounts = null; + public static final String SERIALIZED_NAME_AUTHN_APPS = "authnApps"; + @SerializedName(SERIALIZED_NAME_AUTHN_APPS) + private List authnApps = null; + public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) private String email; @@ -199,6 +203,36 @@ public void setAssociatedMerchantAccounts(List associatedMerchantAccount } + public CompanyUser authnApps(List authnApps) { + + this.authnApps = authnApps; + return this; + } + + public CompanyUser addAuthnAppsItem(String authnAppsItem) { + if (this.authnApps == null) { + this.authnApps = new ArrayList<>(); + } + this.authnApps.add(authnAppsItem); + return this; + } + + /** + * Set of authn apps available to this user + * @return authnApps + **/ + @ApiModelProperty(value = "Set of authn apps available to this user") + + public List getAuthnApps() { + return authnApps; + } + + + public void setAuthnApps(List authnApps) { + this.authnApps = authnApps; + } + + public CompanyUser email(String email) { this.email = email; @@ -350,6 +384,7 @@ public boolean equals(Object o) { Objects.equals(this.accountGroups, companyUser.accountGroups) && Objects.equals(this.active, companyUser.active) && Objects.equals(this.associatedMerchantAccounts, companyUser.associatedMerchantAccounts) && + Objects.equals(this.authnApps, companyUser.authnApps) && Objects.equals(this.email, companyUser.email) && Objects.equals(this.id, companyUser.id) && Objects.equals(this.name, companyUser.name) && @@ -360,7 +395,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(links, accountGroups, active, associatedMerchantAccounts, email, id, name, roles, timeZoneCode, username); + return Objects.hash(links, accountGroups, active, associatedMerchantAccounts, authnApps, email, id, name, roles, timeZoneCode, username); } @Override @@ -371,6 +406,7 @@ public String toString() { sb.append(" accountGroups: ").append(toIndentedString(accountGroups)).append("\n"); sb.append(" active: ").append(toIndentedString(active)).append("\n"); sb.append(" associatedMerchantAccounts: ").append(toIndentedString(associatedMerchantAccounts)).append("\n"); + sb.append(" authnApps: ").append(toIndentedString(authnApps)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -403,6 +439,7 @@ private String toIndentedString(Object o) { openapiFields.add("accountGroups"); openapiFields.add("active"); openapiFields.add("associatedMerchantAccounts"); + openapiFields.add("authnApps"); openapiFields.add("email"); openapiFields.add("id"); openapiFields.add("name"); @@ -460,6 +497,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("associatedMerchantAccounts") != null && !jsonObj.get("associatedMerchantAccounts").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `associatedMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("associatedMerchantAccounts").toString())); } + // ensure the json data is an array + if (jsonObj.get("authnApps") != null && !jsonObj.get("authnApps").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `authnApps` to be an array in the JSON string but got `%s`", jsonObj.get("authnApps").toString())); + } // validate the optional field email if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); diff --git a/src/main/java/com/adyen/model/management/CreateCompanyUserRequest.java b/src/main/java/com/adyen/model/management/CreateCompanyUserRequest.java index 91319cf3b..14ced6043 100644 --- a/src/main/java/com/adyen/model/management/CreateCompanyUserRequest.java +++ b/src/main/java/com/adyen/model/management/CreateCompanyUserRequest.java @@ -59,6 +59,10 @@ public class CreateCompanyUserRequest { @SerializedName(SERIALIZED_NAME_ASSOCIATED_MERCHANT_ACCOUNTS) private List associatedMerchantAccounts = null; + public static final String SERIALIZED_NAME_AUTHN_APPS = "authnApps"; + @SerializedName(SERIALIZED_NAME_AUTHN_APPS) + private List authnApps = null; + public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) private String email; @@ -142,6 +146,36 @@ public void setAssociatedMerchantAccounts(List associatedMerchantAccount } + public CreateCompanyUserRequest authnApps(List authnApps) { + + this.authnApps = authnApps; + return this; + } + + public CreateCompanyUserRequest addAuthnAppsItem(String authnAppsItem) { + if (this.authnApps == null) { + this.authnApps = new ArrayList<>(); + } + this.authnApps.add(authnAppsItem); + return this; + } + + /** + * Set of authn apps to add to this user + * @return authnApps + **/ + @ApiModelProperty(value = "Set of authn apps to add to this user") + + public List getAuthnApps() { + return authnApps; + } + + + public void setAuthnApps(List authnApps) { + this.authnApps = authnApps; + } + + public CreateCompanyUserRequest email(String email) { this.email = email; @@ -272,6 +306,7 @@ public boolean equals(Object o) { CreateCompanyUserRequest createCompanyUserRequest = (CreateCompanyUserRequest) o; return Objects.equals(this.accountGroups, createCompanyUserRequest.accountGroups) && Objects.equals(this.associatedMerchantAccounts, createCompanyUserRequest.associatedMerchantAccounts) && + Objects.equals(this.authnApps, createCompanyUserRequest.authnApps) && Objects.equals(this.email, createCompanyUserRequest.email) && Objects.equals(this.name, createCompanyUserRequest.name) && Objects.equals(this.roles, createCompanyUserRequest.roles) && @@ -281,7 +316,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountGroups, associatedMerchantAccounts, email, name, roles, timeZoneCode, username); + return Objects.hash(accountGroups, associatedMerchantAccounts, authnApps, email, name, roles, timeZoneCode, username); } @Override @@ -290,6 +325,7 @@ public String toString() { sb.append("class CreateCompanyUserRequest {\n"); sb.append(" accountGroups: ").append(toIndentedString(accountGroups)).append("\n"); sb.append(" associatedMerchantAccounts: ").append(toIndentedString(associatedMerchantAccounts)).append("\n"); + sb.append(" authnApps: ").append(toIndentedString(authnApps)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); @@ -319,6 +355,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("accountGroups"); openapiFields.add("associatedMerchantAccounts"); + openapiFields.add("authnApps"); openapiFields.add("email"); openapiFields.add("name"); openapiFields.add("roles"); @@ -369,6 +406,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("associatedMerchantAccounts") != null && !jsonObj.get("associatedMerchantAccounts").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `associatedMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("associatedMerchantAccounts").toString())); } + // ensure the json data is an array + if (jsonObj.get("authnApps") != null && !jsonObj.get("authnApps").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `authnApps` to be an array in the JSON string but got `%s`", jsonObj.get("authnApps").toString())); + } // validate the optional field email if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); diff --git a/src/main/java/com/adyen/model/management/CreateCompanyUserResponse.java b/src/main/java/com/adyen/model/management/CreateCompanyUserResponse.java index 787fb828d..671548bff 100644 --- a/src/main/java/com/adyen/model/management/CreateCompanyUserResponse.java +++ b/src/main/java/com/adyen/model/management/CreateCompanyUserResponse.java @@ -68,6 +68,10 @@ public class CreateCompanyUserResponse { @SerializedName(SERIALIZED_NAME_ASSOCIATED_MERCHANT_ACCOUNTS) private List associatedMerchantAccounts = null; + public static final String SERIALIZED_NAME_AUTHN_APPS = "authnApps"; + @SerializedName(SERIALIZED_NAME_AUTHN_APPS) + private List authnApps = null; + public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) private String email; @@ -199,6 +203,36 @@ public void setAssociatedMerchantAccounts(List associatedMerchantAccount } + public CreateCompanyUserResponse authnApps(List authnApps) { + + this.authnApps = authnApps; + return this; + } + + public CreateCompanyUserResponse addAuthnAppsItem(String authnAppsItem) { + if (this.authnApps == null) { + this.authnApps = new ArrayList<>(); + } + this.authnApps.add(authnAppsItem); + return this; + } + + /** + * Set of authn apps available to this user + * @return authnApps + **/ + @ApiModelProperty(value = "Set of authn apps available to this user") + + public List getAuthnApps() { + return authnApps; + } + + + public void setAuthnApps(List authnApps) { + this.authnApps = authnApps; + } + + public CreateCompanyUserResponse email(String email) { this.email = email; @@ -350,6 +384,7 @@ public boolean equals(Object o) { Objects.equals(this.accountGroups, createCompanyUserResponse.accountGroups) && Objects.equals(this.active, createCompanyUserResponse.active) && Objects.equals(this.associatedMerchantAccounts, createCompanyUserResponse.associatedMerchantAccounts) && + Objects.equals(this.authnApps, createCompanyUserResponse.authnApps) && Objects.equals(this.email, createCompanyUserResponse.email) && Objects.equals(this.id, createCompanyUserResponse.id) && Objects.equals(this.name, createCompanyUserResponse.name) && @@ -360,7 +395,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(links, accountGroups, active, associatedMerchantAccounts, email, id, name, roles, timeZoneCode, username); + return Objects.hash(links, accountGroups, active, associatedMerchantAccounts, authnApps, email, id, name, roles, timeZoneCode, username); } @Override @@ -371,6 +406,7 @@ public String toString() { sb.append(" accountGroups: ").append(toIndentedString(accountGroups)).append("\n"); sb.append(" active: ").append(toIndentedString(active)).append("\n"); sb.append(" associatedMerchantAccounts: ").append(toIndentedString(associatedMerchantAccounts)).append("\n"); + sb.append(" authnApps: ").append(toIndentedString(authnApps)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -403,6 +439,7 @@ private String toIndentedString(Object o) { openapiFields.add("accountGroups"); openapiFields.add("active"); openapiFields.add("associatedMerchantAccounts"); + openapiFields.add("authnApps"); openapiFields.add("email"); openapiFields.add("id"); openapiFields.add("name"); @@ -460,6 +497,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("associatedMerchantAccounts") != null && !jsonObj.get("associatedMerchantAccounts").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `associatedMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("associatedMerchantAccounts").toString())); } + // ensure the json data is an array + if (jsonObj.get("authnApps") != null && !jsonObj.get("authnApps").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `authnApps` to be an array in the JSON string but got `%s`", jsonObj.get("authnApps").toString())); + } // validate the optional field email if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); diff --git a/src/main/java/com/adyen/model/management/CreateCompanyWebhookRequest.java b/src/main/java/com/adyen/model/management/CreateCompanyWebhookRequest.java index bcc4db8b7..7681839a1 100644 --- a/src/main/java/com/adyen/model/management/CreateCompanyWebhookRequest.java +++ b/src/main/java/com/adyen/model/management/CreateCompanyWebhookRequest.java @@ -76,11 +76,11 @@ public class CreateCompanyWebhookRequest { */ @JsonAdapter(CommunicationFormatEnum.Adapter.class) public enum CommunicationFormatEnum { - HTTP("HTTP"), + HTTP("http"), - JSON("JSON"), + JSON("json"), - SOAP("SOAP"); + SOAP("soap"); private String value; @@ -133,11 +133,11 @@ public CommunicationFormatEnum read(final JsonReader jsonReader) throws IOExcept */ @JsonAdapter(FilterMerchantAccountTypeEnum.Adapter.class) public enum FilterMerchantAccountTypeEnum { - EXCLUDE_LIST("EXCLUDE_LIST"), + ALLACCOUNTS("allAccounts"), - INCLUDE_ALL("INCLUDE_ALL"), + EXCLUDEACCOUNTS("excludeAccounts"), - INCLUDE_LIST("INCLUDE_LIST"); + INCLUDEACCOUNTS("includeAccounts"); private String value; @@ -253,21 +253,17 @@ public enum SslVersionEnum { SSL("SSL"), - SSLV3("SSLV3"), - - SSL_INSECURE_CIPHERS("SSL_INSECURE_CIPHERS"), + SSLV3("SSLv3"), TLS("TLS"), - TLSV1("TLSV1"), - - TLSV1_1("TLSV1_1"), + TLSV1("TLSv1"), - TLSV1_2("TLSV1_2"), + TLSV1_1("TLSv1.1"), - TLSV1_3("TLSV1_3"), + TLSV1_2("TLSv1.2"), - TLSV1_INSECURE_CIPHERS("TLSV1_INSECURE_CIPHERS"); + TLSV1_3("TLSv1.3"); private String value; @@ -446,7 +442,7 @@ public CreateCompanyWebhookRequest communicationFormat(CommunicationFormatEnum c * Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** * @return communicationFormat **/ - @ApiModelProperty(example = "SOAP", required = true, value = "Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** ") + @ApiModelProperty(example = "soap", required = true, value = "Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** ") public CommunicationFormatEnum getCommunicationFormat() { return communicationFormat; diff --git a/src/main/java/com/adyen/model/management/CreateMerchantUserRequest.java b/src/main/java/com/adyen/model/management/CreateMerchantUserRequest.java index f840032e1..c2c68dce2 100644 --- a/src/main/java/com/adyen/model/management/CreateMerchantUserRequest.java +++ b/src/main/java/com/adyen/model/management/CreateMerchantUserRequest.java @@ -55,6 +55,10 @@ public class CreateMerchantUserRequest { @SerializedName(SERIALIZED_NAME_ACCOUNT_GROUPS) private List accountGroups = null; + public static final String SERIALIZED_NAME_AUTHN_APPS = "authnApps"; + @SerializedName(SERIALIZED_NAME_AUTHN_APPS) + private List authnApps = null; + public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) private String email; @@ -108,6 +112,36 @@ public void setAccountGroups(List accountGroups) { } + public CreateMerchantUserRequest authnApps(List authnApps) { + + this.authnApps = authnApps; + return this; + } + + public CreateMerchantUserRequest addAuthnAppsItem(String authnAppsItem) { + if (this.authnApps == null) { + this.authnApps = new ArrayList<>(); + } + this.authnApps.add(authnAppsItem); + return this; + } + + /** + * Set of authn apps to add to this user + * @return authnApps + **/ + @ApiModelProperty(value = "Set of authn apps to add to this user") + + public List getAuthnApps() { + return authnApps; + } + + + public void setAuthnApps(List authnApps) { + this.authnApps = authnApps; + } + + public CreateMerchantUserRequest email(String email) { this.email = email; @@ -237,6 +271,7 @@ public boolean equals(Object o) { } CreateMerchantUserRequest createMerchantUserRequest = (CreateMerchantUserRequest) o; return Objects.equals(this.accountGroups, createMerchantUserRequest.accountGroups) && + Objects.equals(this.authnApps, createMerchantUserRequest.authnApps) && Objects.equals(this.email, createMerchantUserRequest.email) && Objects.equals(this.name, createMerchantUserRequest.name) && Objects.equals(this.roles, createMerchantUserRequest.roles) && @@ -246,7 +281,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountGroups, email, name, roles, timeZoneCode, username); + return Objects.hash(accountGroups, authnApps, email, name, roles, timeZoneCode, username); } @Override @@ -254,6 +289,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateMerchantUserRequest {\n"); sb.append(" accountGroups: ").append(toIndentedString(accountGroups)).append("\n"); + sb.append(" authnApps: ").append(toIndentedString(authnApps)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); @@ -282,6 +318,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("accountGroups"); + openapiFields.add("authnApps"); openapiFields.add("email"); openapiFields.add("name"); openapiFields.add("roles"); @@ -328,6 +365,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("accountGroups") != null && !jsonObj.get("accountGroups").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `accountGroups` to be an array in the JSON string but got `%s`", jsonObj.get("accountGroups").toString())); } + // ensure the json data is an array + if (jsonObj.get("authnApps") != null && !jsonObj.get("authnApps").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `authnApps` to be an array in the JSON string but got `%s`", jsonObj.get("authnApps").toString())); + } // validate the optional field email if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); diff --git a/src/main/java/com/adyen/model/management/CreateMerchantWebhookRequest.java b/src/main/java/com/adyen/model/management/CreateMerchantWebhookRequest.java index a66719f47..3be78957e 100644 --- a/src/main/java/com/adyen/model/management/CreateMerchantWebhookRequest.java +++ b/src/main/java/com/adyen/model/management/CreateMerchantWebhookRequest.java @@ -74,11 +74,11 @@ public class CreateMerchantWebhookRequest { */ @JsonAdapter(CommunicationFormatEnum.Adapter.class) public enum CommunicationFormatEnum { - HTTP("HTTP"), + HTTP("http"), - JSON("JSON"), + JSON("json"), - SOAP("SOAP"); + SOAP("soap"); private String value; @@ -194,21 +194,17 @@ public enum SslVersionEnum { SSL("SSL"), - SSLV3("SSLV3"), - - SSL_INSECURE_CIPHERS("SSL_INSECURE_CIPHERS"), + SSLV3("SSLv3"), TLS("TLS"), - TLSV1("TLSV1"), - - TLSV1_1("TLSV1_1"), + TLSV1("TLSv1"), - TLSV1_2("TLSV1_2"), + TLSV1_1("TLSv1.1"), - TLSV1_3("TLSV1_3"), + TLSV1_2("TLSv1.2"), - TLSV1_INSECURE_CIPHERS("TLSV1_INSECURE_CIPHERS"); + TLSV1_3("TLSv1.3"); private String value; @@ -387,7 +383,7 @@ public CreateMerchantWebhookRequest communicationFormat(CommunicationFormatEnum * Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** * @return communicationFormat **/ - @ApiModelProperty(example = "SOAP", required = true, value = "Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** ") + @ApiModelProperty(example = "soap", required = true, value = "Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** ") public CommunicationFormatEnum getCommunicationFormat() { return communicationFormat; diff --git a/src/main/java/com/adyen/model/management/CreateUserResponse.java b/src/main/java/com/adyen/model/management/CreateUserResponse.java index 19e007b3e..c2a5d476c 100644 --- a/src/main/java/com/adyen/model/management/CreateUserResponse.java +++ b/src/main/java/com/adyen/model/management/CreateUserResponse.java @@ -64,6 +64,10 @@ public class CreateUserResponse { @SerializedName(SERIALIZED_NAME_ACTIVE) private Boolean active; + public static final String SERIALIZED_NAME_AUTHN_APPS = "authnApps"; + @SerializedName(SERIALIZED_NAME_AUTHN_APPS) + private List authnApps = null; + public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) private String email; @@ -165,6 +169,36 @@ public void setActive(Boolean active) { } + public CreateUserResponse authnApps(List authnApps) { + + this.authnApps = authnApps; + return this; + } + + public CreateUserResponse addAuthnAppsItem(String authnAppsItem) { + if (this.authnApps == null) { + this.authnApps = new ArrayList<>(); + } + this.authnApps.add(authnAppsItem); + return this; + } + + /** + * Set of authn apps available to this user + * @return authnApps + **/ + @ApiModelProperty(value = "Set of authn apps available to this user") + + public List getAuthnApps() { + return authnApps; + } + + + public void setAuthnApps(List authnApps) { + this.authnApps = authnApps; + } + + public CreateUserResponse email(String email) { this.email = email; @@ -315,6 +349,7 @@ public boolean equals(Object o) { return Objects.equals(this.links, createUserResponse.links) && Objects.equals(this.accountGroups, createUserResponse.accountGroups) && Objects.equals(this.active, createUserResponse.active) && + Objects.equals(this.authnApps, createUserResponse.authnApps) && Objects.equals(this.email, createUserResponse.email) && Objects.equals(this.id, createUserResponse.id) && Objects.equals(this.name, createUserResponse.name) && @@ -325,7 +360,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(links, accountGroups, active, email, id, name, roles, timeZoneCode, username); + return Objects.hash(links, accountGroups, active, authnApps, email, id, name, roles, timeZoneCode, username); } @Override @@ -335,6 +370,7 @@ public String toString() { sb.append(" links: ").append(toIndentedString(links)).append("\n"); sb.append(" accountGroups: ").append(toIndentedString(accountGroups)).append("\n"); sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" authnApps: ").append(toIndentedString(authnApps)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -366,6 +402,7 @@ private String toIndentedString(Object o) { openapiFields.add("_links"); openapiFields.add("accountGroups"); openapiFields.add("active"); + openapiFields.add("authnApps"); openapiFields.add("email"); openapiFields.add("id"); openapiFields.add("name"); @@ -419,6 +456,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("accountGroups") != null && !jsonObj.get("accountGroups").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `accountGroups` to be an array in the JSON string but got `%s`", jsonObj.get("accountGroups").toString())); } + // ensure the json data is an array + if (jsonObj.get("authnApps") != null && !jsonObj.get("authnApps").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `authnApps` to be an array in the JSON string but got `%s`", jsonObj.get("authnApps").toString())); + } // validate the optional field email if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); diff --git a/src/main/java/com/adyen/model/management/GooglePayInfo.java b/src/main/java/com/adyen/model/management/GooglePayInfo.java index fd0ebe9fd..8b583d8b7 100644 --- a/src/main/java/com/adyen/model/management/GooglePayInfo.java +++ b/src/main/java/com/adyen/model/management/GooglePayInfo.java @@ -52,6 +52,10 @@ public class GooglePayInfo { @SerializedName(SERIALIZED_NAME_MERCHANT_ID) private String merchantId; + public static final String SERIALIZED_NAME_REUSE_MERCHANT_ID = "reuseMerchantId"; + @SerializedName(SERIALIZED_NAME_REUSE_MERCHANT_ID) + private Boolean reuseMerchantId; + public GooglePayInfo() { } @@ -65,7 +69,7 @@ public GooglePayInfo merchantId(String merchantId) { * Google Pay [Merchant ID](https://support.google.com/paymentscenter/answer/7163092?hl=en). Character length and limitations: 16 alphanumeric characters or 20 numeric characters. * @return merchantId **/ - @ApiModelProperty(value = "Google Pay [Merchant ID](https://support.google.com/paymentscenter/answer/7163092?hl=en). Character length and limitations: 16 alphanumeric characters or 20 numeric characters.") + @ApiModelProperty(required = true, value = "Google Pay [Merchant ID](https://support.google.com/paymentscenter/answer/7163092?hl=en). Character length and limitations: 16 alphanumeric characters or 20 numeric characters.") public String getMerchantId() { return merchantId; @@ -77,6 +81,28 @@ public void setMerchantId(String merchantId) { } + public GooglePayInfo reuseMerchantId(Boolean reuseMerchantId) { + + this.reuseMerchantId = reuseMerchantId; + return this; + } + + /** + * Indicates whether the Google Pay Merchant ID is used for several merchant accounts. Default value: **false**. + * @return reuseMerchantId + **/ + @ApiModelProperty(value = "Indicates whether the Google Pay Merchant ID is used for several merchant accounts. Default value: **false**.") + + public Boolean getReuseMerchantId() { + return reuseMerchantId; + } + + + public void setReuseMerchantId(Boolean reuseMerchantId) { + this.reuseMerchantId = reuseMerchantId; + } + + @Override public boolean equals(Object o) { @@ -87,12 +113,13 @@ public boolean equals(Object o) { return false; } GooglePayInfo googlePayInfo = (GooglePayInfo) o; - return Objects.equals(this.merchantId, googlePayInfo.merchantId); + return Objects.equals(this.merchantId, googlePayInfo.merchantId) && + Objects.equals(this.reuseMerchantId, googlePayInfo.reuseMerchantId); } @Override public int hashCode() { - return Objects.hash(merchantId); + return Objects.hash(merchantId, reuseMerchantId); } @Override @@ -100,6 +127,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class GooglePayInfo {\n"); sb.append(" merchantId: ").append(toIndentedString(merchantId)).append("\n"); + sb.append(" reuseMerchantId: ").append(toIndentedString(reuseMerchantId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -123,9 +151,11 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("merchantId"); + openapiFields.add("reuseMerchantId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("merchantId"); } /** @@ -150,6 +180,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GooglePayInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GooglePayInfo.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } // validate the optional field merchantId if (jsonObj.get("merchantId") != null && !jsonObj.get("merchantId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `merchantId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantId").toString())); diff --git a/src/main/java/com/adyen/model/management/JSON.java b/src/main/java/com/adyen/model/management/JSON.java index 9f64a781e..8ae19af4b 100644 --- a/src/main/java/com/adyen/model/management/JSON.java +++ b/src/main/java/com/adyen/model/management/JSON.java @@ -178,7 +178,9 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.OrderItem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.PaginationLinks.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.Passcodes.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.PayAtTable.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.PayPalInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.Payment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.PaymentMethod.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.PaymentMethodResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.PaymentMethodSetupInfo.CustomTypeAdapterFactory()); @@ -237,6 +239,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.UpdateStoreRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.Url.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.User.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.VippsInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.Webhook.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.WebhookLinks.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.WifiProfiles.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/adyen/model/management/Opi.java b/src/main/java/com/adyen/model/management/Opi.java index f6c869426..7f214ecc5 100644 --- a/src/main/java/com/adyen/model/management/Opi.java +++ b/src/main/java/com/adyen/model/management/Opi.java @@ -70,10 +70,10 @@ public Opi enablePayAtTable(Boolean enablePayAtTable) { } /** - * Indicates if Pay at Table is enabled. + * Indicates if Pay at table is enabled. * @return enablePayAtTable **/ - @ApiModelProperty(value = "Indicates if Pay at Table is enabled.") + @ApiModelProperty(value = "Indicates if Pay at table is enabled.") public Boolean getEnablePayAtTable() { return enablePayAtTable; diff --git a/src/main/java/com/adyen/model/management/OrderItem.java b/src/main/java/com/adyen/model/management/OrderItem.java index a8a80b699..cf70a87e9 100644 --- a/src/main/java/com/adyen/model/management/OrderItem.java +++ b/src/main/java/com/adyen/model/management/OrderItem.java @@ -52,6 +52,10 @@ public class OrderItem { @SerializedName(SERIALIZED_NAME_ID) private String id; + public static final String SERIALIZED_NAME_INSTALLMENTS = "installments"; + @SerializedName(SERIALIZED_NAME_INSTALLMENTS) + private Long installments; + public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) private String name; @@ -85,6 +89,28 @@ public void setId(String id) { } + public OrderItem installments(Long installments) { + + this.installments = installments; + return this; + } + + /** + * The number of installments for the specified product `id`. + * @return installments + **/ + @ApiModelProperty(value = "The number of installments for the specified product `id`.") + + public Long getInstallments() { + return installments; + } + + + public void setInstallments(Long installments) { + this.installments = installments; + } + + public OrderItem name(String name) { this.name = name; @@ -140,13 +166,14 @@ public boolean equals(Object o) { } OrderItem orderItem = (OrderItem) o; return Objects.equals(this.id, orderItem.id) && + Objects.equals(this.installments, orderItem.installments) && Objects.equals(this.name, orderItem.name) && Objects.equals(this.quantity, orderItem.quantity); } @Override public int hashCode() { - return Objects.hash(id, name, quantity); + return Objects.hash(id, installments, name, quantity); } @Override @@ -154,6 +181,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class OrderItem {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" installments: ").append(toIndentedString(installments)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); sb.append("}"); @@ -179,6 +207,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("id"); + openapiFields.add("installments"); openapiFields.add("name"); openapiFields.add("quantity"); diff --git a/src/main/java/com/adyen/model/management/PayAtTable.java b/src/main/java/com/adyen/model/management/PayAtTable.java new file mode 100644 index 000000000..7d12d63cd --- /dev/null +++ b/src/main/java/com/adyen/model/management/PayAtTable.java @@ -0,0 +1,287 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.management; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.management.JSON; + +/** + * PayAtTable + */ + +public class PayAtTable { + /** + * Allowed authentication methods: Magswipe, Manual Entry. + */ + @JsonAdapter(AuthenticationMethodEnum.Adapter.class) + public enum AuthenticationMethodEnum { + MAGSWIPE("MAGSWIPE"), + + MKE("MKE"); + + private String value; + + AuthenticationMethodEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AuthenticationMethodEnum fromValue(String value) { + for (AuthenticationMethodEnum b : AuthenticationMethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AuthenticationMethodEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AuthenticationMethodEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AuthenticationMethodEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AUTHENTICATION_METHOD = "authenticationMethod"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATION_METHOD) + private AuthenticationMethodEnum authenticationMethod; + + public static final String SERIALIZED_NAME_ENABLE_PAY_AT_TABLE = "enablePayAtTable"; + @SerializedName(SERIALIZED_NAME_ENABLE_PAY_AT_TABLE) + private Boolean enablePayAtTable; + + public PayAtTable() { + } + + public PayAtTable authenticationMethod(AuthenticationMethodEnum authenticationMethod) { + + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Allowed authentication methods: Magswipe, Manual Entry. + * @return authenticationMethod + **/ + @ApiModelProperty(value = "Allowed authentication methods: Magswipe, Manual Entry.") + + public AuthenticationMethodEnum getAuthenticationMethod() { + return authenticationMethod; + } + + + public void setAuthenticationMethod(AuthenticationMethodEnum authenticationMethod) { + this.authenticationMethod = authenticationMethod; + } + + + public PayAtTable enablePayAtTable(Boolean enablePayAtTable) { + + this.enablePayAtTable = enablePayAtTable; + return this; + } + + /** + * Enable Pay at table. + * @return enablePayAtTable + **/ + @ApiModelProperty(value = "Enable Pay at table.") + + public Boolean getEnablePayAtTable() { + return enablePayAtTable; + } + + + public void setEnablePayAtTable(Boolean enablePayAtTable) { + this.enablePayAtTable = enablePayAtTable; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PayAtTable payAtTable = (PayAtTable) o; + return Objects.equals(this.authenticationMethod, payAtTable.authenticationMethod) && + Objects.equals(this.enablePayAtTable, payAtTable.enablePayAtTable); + } + + @Override + public int hashCode() { + return Objects.hash(authenticationMethod, enablePayAtTable); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PayAtTable {\n"); + sb.append(" authenticationMethod: ").append(toIndentedString(authenticationMethod)).append("\n"); + sb.append(" enablePayAtTable: ").append(toIndentedString(enablePayAtTable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("authenticationMethod"); + openapiFields.add("enablePayAtTable"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PayAtTable + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PayAtTable.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PayAtTable is not found in the empty JSON string", PayAtTable.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PayAtTable.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PayAtTable` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the field authenticationMethod can be parsed to an enum value + if (jsonObj.get("authenticationMethod") != null) { + if(!jsonObj.get("authenticationMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authenticationMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticationMethod").toString())); + } + AuthenticationMethodEnum.fromValue(jsonObj.get("authenticationMethod").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PayAtTable.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PayAtTable' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PayAtTable.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PayAtTable value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PayAtTable read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PayAtTable given an JSON string + * + * @param jsonString JSON string + * @return An instance of PayAtTable + * @throws IOException if the JSON string is invalid with respect to PayAtTable + */ + public static PayAtTable fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PayAtTable.class); + } + + /** + * Convert an instance of PayAtTable to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccount.java b/src/main/java/com/adyen/model/management/Payment.java similarity index 54% rename from src/main/java/com/adyen/model/balanceplatform/BankAccount.java rename to src/main/java/com/adyen/model/management/Payment.java index 8fd96aa15..2b69d9b8e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccount.java +++ b/src/main/java/com/adyen/model/management/Payment.java @@ -1,7 +1,7 @@ /* - * Configuration API + * Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 1 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,7 +10,7 @@ */ -package com.adyen.model.balanceplatform; +package com.adyen.model.management; import java.util.Objects; import java.util.Arrays; @@ -22,6 +22,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -41,39 +43,47 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.balanceplatform.JSON; +import com.adyen.model.management.JSON; /** - * BankAccount + * Payment */ -public class BankAccount { - public static final String SERIALIZED_NAME_IBAN = "iban"; - @SerializedName(SERIALIZED_NAME_IBAN) - private String iban; +public class Payment { + public static final String SERIALIZED_NAME_HIDE_MINOR_UNITS_IN_CURRENCIES = "hideMinorUnitsInCurrencies"; + @SerializedName(SERIALIZED_NAME_HIDE_MINOR_UNITS_IN_CURRENCIES) + private List hideMinorUnitsInCurrencies = null; - public BankAccount() { + public Payment() { } - public BankAccount iban(String iban) { + public Payment hideMinorUnitsInCurrencies(List hideMinorUnitsInCurrencies) { - this.iban = iban; + this.hideMinorUnitsInCurrencies = hideMinorUnitsInCurrencies; + return this; + } + + public Payment addHideMinorUnitsInCurrenciesItem(String hideMinorUnitsInCurrenciesItem) { + if (this.hideMinorUnitsInCurrencies == null) { + this.hideMinorUnitsInCurrencies = new ArrayList<>(); + } + this.hideMinorUnitsInCurrencies.add(hideMinorUnitsInCurrenciesItem); return this; } /** - * The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN). - * @return iban + * Hides the minor units for the listed [ISO currency codes](https://en.wikipedia.org/wiki/ISO_4217). + * @return hideMinorUnitsInCurrencies **/ - @ApiModelProperty(required = true, value = "The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN).") + @ApiModelProperty(value = "Hides the minor units for the listed [ISO currency codes](https://en.wikipedia.org/wiki/ISO_4217).") - public String getIban() { - return iban; + public List getHideMinorUnitsInCurrencies() { + return hideMinorUnitsInCurrencies; } - public void setIban(String iban) { - this.iban = iban; + public void setHideMinorUnitsInCurrencies(List hideMinorUnitsInCurrencies) { + this.hideMinorUnitsInCurrencies = hideMinorUnitsInCurrencies; } @@ -86,20 +96,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - BankAccount bankAccount = (BankAccount) o; - return Objects.equals(this.iban, bankAccount.iban); + Payment payment = (Payment) o; + return Objects.equals(this.hideMinorUnitsInCurrencies, payment.hideMinorUnitsInCurrencies); } @Override public int hashCode() { - return Objects.hash(iban); + return Objects.hash(hideMinorUnitsInCurrencies); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class BankAccount {\n"); - sb.append(" iban: ").append(toIndentedString(iban)).append("\n"); + sb.append("class Payment {\n"); + sb.append(" hideMinorUnitsInCurrencies: ").append(toIndentedString(hideMinorUnitsInCurrencies)).append("\n"); sb.append("}"); return sb.toString(); } @@ -122,45 +132,37 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("iban"); + openapiFields.add("hideMinorUnitsInCurrencies"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("iban"); } /** * Validates the JSON Object and throws an exception if issues found * * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to BankAccount + * @throws IOException if the JSON Object is invalid with respect to Payment */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { - if (BankAccount.openapiRequiredFields.isEmpty()) { + if (Payment.openapiRequiredFields.isEmpty()) { return; } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in BankAccount is not found in the empty JSON string", BankAccount.openapiRequiredFields.toString())); + throw new IllegalArgumentException(String.format("The required field(s) %s in Payment is not found in the empty JSON string", Payment.openapiRequiredFields.toString())); } } Set> entries = jsonObj.entrySet(); // check to see if the JSON string contains additional fields for (Entry entry : entries) { - if (!BankAccount.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BankAccount` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BankAccount.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + if (!Payment.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Payment` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - // validate the optional field iban - if (jsonObj.get("iban") != null && !jsonObj.get("iban").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `iban` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iban").toString())); + // ensure the json data is an array + if (jsonObj.get("hideMinorUnitsInCurrencies") != null && !jsonObj.get("hideMinorUnitsInCurrencies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `hideMinorUnitsInCurrencies` to be an array in the JSON string but got `%s`", jsonObj.get("hideMinorUnitsInCurrencies").toString())); } } @@ -168,22 +170,22 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!BankAccount.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'BankAccount' and its subtypes + if (!Payment.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Payment' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(BankAccount.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Payment.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, BankAccount value) throws IOException { + public void write(JsonWriter out, Payment value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public BankAccount read(JsonReader in) throws IOException { + public Payment read(JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); return thisAdapter.fromJsonTree(jsonObj); @@ -194,18 +196,18 @@ public BankAccount read(JsonReader in) throws IOException { } /** - * Create an instance of BankAccount given an JSON string + * Create an instance of Payment given an JSON string * * @param jsonString JSON string - * @return An instance of BankAccount - * @throws IOException if the JSON string is invalid with respect to BankAccount + * @return An instance of Payment + * @throws IOException if the JSON string is invalid with respect to Payment */ - public static BankAccount fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, BankAccount.class); + public static Payment fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Payment.class); } /** - * Convert an instance of BankAccount to an JSON string + * Convert an instance of Payment to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/adyen/model/management/PaymentMethod.java b/src/main/java/com/adyen/model/management/PaymentMethod.java index fa3fbf0fd..5d9b38c6d 100644 --- a/src/main/java/com/adyen/model/management/PaymentMethod.java +++ b/src/main/java/com/adyen/model/management/PaymentMethod.java @@ -24,6 +24,7 @@ import com.adyen.model.management.PayPalInfo; import com.adyen.model.management.SofortInfo; import com.adyen.model.management.SwishInfo; +import com.adyen.model.management.VippsInfo; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -199,6 +200,10 @@ public VerificationStatusEnum read(final JsonReader jsonReader) throws IOExcepti @SerializedName(SERIALIZED_NAME_VERIFICATION_STATUS) private VerificationStatusEnum verificationStatus; + public static final String SERIALIZED_NAME_VIPPS = "vipps"; + @SerializedName(SERIALIZED_NAME_VIPPS) + private VippsInfo vipps; + public PaymentMethod() { } @@ -710,6 +715,28 @@ public void setVerificationStatus(VerificationStatusEnum verificationStatus) { } + public PaymentMethod vipps(VippsInfo vipps) { + + this.vipps = vipps; + return this; + } + + /** + * Get vipps + * @return vipps + **/ + @ApiModelProperty(value = "") + + public VippsInfo getVipps() { + return vipps; + } + + + public void setVipps(VippsInfo vipps) { + this.vipps = vipps; + } + + @Override public boolean equals(Object o) { @@ -741,12 +768,13 @@ public boolean equals(Object o) { Objects.equals(this.storeId, paymentMethod.storeId) && Objects.equals(this.swish, paymentMethod.swish) && Objects.equals(this.type, paymentMethod.type) && - Objects.equals(this.verificationStatus, paymentMethod.verificationStatus); + Objects.equals(this.verificationStatus, paymentMethod.verificationStatus) && + Objects.equals(this.vipps, paymentMethod.vipps); } @Override public int hashCode() { - return Objects.hash(allowed, applePay, bcmc, businessLineId, cartesBancaires, countries, currencies, customRoutingFlags, enabled, giroPay, googlePay, id, klarna, mealVoucherFR, paypal, reference, shopperInteraction, sofort, storeId, swish, type, verificationStatus); + return Objects.hash(allowed, applePay, bcmc, businessLineId, cartesBancaires, countries, currencies, customRoutingFlags, enabled, giroPay, googlePay, id, klarna, mealVoucherFR, paypal, reference, shopperInteraction, sofort, storeId, swish, type, verificationStatus, vipps); } @Override @@ -775,6 +803,7 @@ public String toString() { sb.append(" swish: ").append(toIndentedString(swish)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" verificationStatus: ").append(toIndentedString(verificationStatus)).append("\n"); + sb.append(" vipps: ").append(toIndentedString(vipps)).append("\n"); sb.append("}"); return sb.toString(); } @@ -819,6 +848,7 @@ private String toIndentedString(Object o) { openapiFields.add("swish"); openapiFields.add("type"); openapiFields.add("verificationStatus"); + openapiFields.add("vipps"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -937,6 +967,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } VerificationStatusEnum.fromValue(jsonObj.get("verificationStatus").getAsString()); } + // validate the optional field `vipps` + if (jsonObj.getAsJsonObject("vipps") != null) { + VippsInfo.validateJsonObject(jsonObj.getAsJsonObject("vipps")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/adyen/model/management/PaymentMethodResponse.java b/src/main/java/com/adyen/model/management/PaymentMethodResponse.java index 9c4bbaf4a..c718d069e 100644 --- a/src/main/java/com/adyen/model/management/PaymentMethodResponse.java +++ b/src/main/java/com/adyen/model/management/PaymentMethodResponse.java @@ -73,8 +73,12 @@ public class PaymentMethodResponse { */ @JsonAdapter(TypesWithErrorsEnum.Adapter.class) public enum TypesWithErrorsEnum { + AFTERPAYTOUCH("afterpaytouch"), + ALIPAY("alipay"), + ALIPAY_HK("alipay_hk"), + AMEX("amex"), APPLEPAY("applepay"), @@ -85,6 +89,8 @@ public enum TypesWithErrorsEnum { CARTEBANCAIRE("cartebancaire"), + CLEARPAY("clearpay"), + CUP("cup"), DINERS("diners"), @@ -141,6 +147,8 @@ public enum TypesWithErrorsEnum { MULTIBANCO("multibanco"), + ONLINEBANKING_PL("onlineBanking_PL"), + PAYPAL("paypal"), PAYSHOP("payshop"), @@ -149,6 +157,8 @@ public enum TypesWithErrorsEnum { TRUSTLY("trustly"), + VIPPS("vipps"), + VISA("visa"), VISADEBIT("visadebit"), diff --git a/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java b/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java index 8d8ceacfb..344e85cdd 100644 --- a/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java +++ b/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java @@ -24,6 +24,7 @@ import com.adyen.model.management.PayPalInfo; import com.adyen.model.management.SofortInfo; import com.adyen.model.management.SwishInfo; +import com.adyen.model.management.VippsInfo; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -184,8 +185,12 @@ public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOExcepti */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { + AFTERPAYTOUCH("afterpaytouch"), + ALIPAY("alipay"), + ALIPAY_HK("alipay_hk"), + AMEX("amex"), APPLEPAY("applepay"), @@ -196,6 +201,8 @@ public enum TypeEnum { CARTEBANCAIRE("cartebancaire"), + CLEARPAY("clearpay"), + CUP("cup"), DINERS("diners"), @@ -252,6 +259,8 @@ public enum TypeEnum { MULTIBANCO("multibanco"), + ONLINEBANKING_PL("onlineBanking_PL"), + PAYPAL("paypal"), PAYSHOP("payshop"), @@ -260,6 +269,8 @@ public enum TypeEnum { TRUSTLY("trustly"), + VIPPS("vipps"), + VISA("visa"), VISADEBIT("visadebit"), @@ -312,6 +323,10 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_TYPE) private TypeEnum type; + public static final String SERIALIZED_NAME_VIPPS = "vipps"; + @SerializedName(SERIALIZED_NAME_VIPPS) + private VippsInfo vipps; + public PaymentMethodSetupInfo() { } @@ -735,6 +750,28 @@ public void setType(TypeEnum type) { } + public PaymentMethodSetupInfo vipps(VippsInfo vipps) { + + this.vipps = vipps; + return this; + } + + /** + * Get vipps + * @return vipps + **/ + @ApiModelProperty(value = "") + + public VippsInfo getVipps() { + return vipps; + } + + + public void setVipps(VippsInfo vipps) { + this.vipps = vipps; + } + + @Override public boolean equals(Object o) { @@ -762,12 +799,13 @@ public boolean equals(Object o) { Objects.equals(this.sofort, paymentMethodSetupInfo.sofort) && Objects.equals(this.storeId, paymentMethodSetupInfo.storeId) && Objects.equals(this.swish, paymentMethodSetupInfo.swish) && - Objects.equals(this.type, paymentMethodSetupInfo.type); + Objects.equals(this.type, paymentMethodSetupInfo.type) && + Objects.equals(this.vipps, paymentMethodSetupInfo.vipps); } @Override public int hashCode() { - return Objects.hash(applePay, bcmc, businessLineId, cartesBancaires, countries, currencies, customRoutingFlags, giroPay, googlePay, klarna, mealVoucherFR, paypal, reference, shopperInteraction, sofort, storeId, swish, type); + return Objects.hash(applePay, bcmc, businessLineId, cartesBancaires, countries, currencies, customRoutingFlags, giroPay, googlePay, klarna, mealVoucherFR, paypal, reference, shopperInteraction, sofort, storeId, swish, type, vipps); } @Override @@ -792,6 +830,7 @@ public String toString() { sb.append(" storeId: ").append(toIndentedString(storeId)).append("\n"); sb.append(" swish: ").append(toIndentedString(swish)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" vipps: ").append(toIndentedString(vipps)).append("\n"); sb.append("}"); return sb.toString(); } @@ -832,6 +871,7 @@ private String toIndentedString(Object o) { openapiFields.add("storeId"); openapiFields.add("swish"); openapiFields.add("type"); + openapiFields.add("vipps"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -937,6 +977,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } TypeEnum.fromValue(jsonObj.get("type").getAsString()); } + // validate the optional field `vipps` + if (jsonObj.getAsJsonObject("vipps") != null) { + VippsInfo.validateJsonObject(jsonObj.getAsJsonObject("vipps")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/adyen/model/management/TerminalSettings.java b/src/main/java/com/adyen/model/management/TerminalSettings.java index 556e01288..8d92a54e0 100644 --- a/src/main/java/com/adyen/model/management/TerminalSettings.java +++ b/src/main/java/com/adyen/model/management/TerminalSettings.java @@ -22,6 +22,8 @@ import com.adyen.model.management.OfflineProcessing; import com.adyen.model.management.Opi; import com.adyen.model.management.Passcodes; +import com.adyen.model.management.PayAtTable; +import com.adyen.model.management.Payment; import com.adyen.model.management.ReceiptOptions; import com.adyen.model.management.ReceiptPrinting; import com.adyen.model.management.Signature; @@ -97,6 +99,14 @@ public class TerminalSettings { @SerializedName(SERIALIZED_NAME_PASSCODES) private Passcodes passcodes; + public static final String SERIALIZED_NAME_PAY_AT_TABLE = "payAtTable"; + @SerializedName(SERIALIZED_NAME_PAY_AT_TABLE) + private PayAtTable payAtTable; + + public static final String SERIALIZED_NAME_PAYMENT = "payment"; + @SerializedName(SERIALIZED_NAME_PAYMENT) + private Payment payment; + public static final String SERIALIZED_NAME_RECEIPT_OPTIONS = "receiptOptions"; @SerializedName(SERIALIZED_NAME_RECEIPT_OPTIONS) private ReceiptOptions receiptOptions; @@ -312,6 +322,50 @@ public void setPasscodes(Passcodes passcodes) { } + public TerminalSettings payAtTable(PayAtTable payAtTable) { + + this.payAtTable = payAtTable; + return this; + } + + /** + * Get payAtTable + * @return payAtTable + **/ + @ApiModelProperty(value = "") + + public PayAtTable getPayAtTable() { + return payAtTable; + } + + + public void setPayAtTable(PayAtTable payAtTable) { + this.payAtTable = payAtTable; + } + + + public TerminalSettings payment(Payment payment) { + + this.payment = payment; + return this; + } + + /** + * Get payment + * @return payment + **/ + @ApiModelProperty(value = "") + + public Payment getPayment() { + return payment; + } + + + public void setPayment(Payment payment) { + this.payment = payment; + } + + public TerminalSettings receiptOptions(ReceiptOptions receiptOptions) { this.receiptOptions = receiptOptions; @@ -484,6 +538,8 @@ public boolean equals(Object o) { Objects.equals(this.offlineProcessing, terminalSettings.offlineProcessing) && Objects.equals(this.opi, terminalSettings.opi) && Objects.equals(this.passcodes, terminalSettings.passcodes) && + Objects.equals(this.payAtTable, terminalSettings.payAtTable) && + Objects.equals(this.payment, terminalSettings.payment) && Objects.equals(this.receiptOptions, terminalSettings.receiptOptions) && Objects.equals(this.receiptPrinting, terminalSettings.receiptPrinting) && Objects.equals(this.signature, terminalSettings.signature) && @@ -495,7 +551,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(cardholderReceipt, connectivity, gratuities, hardware, nexo, offlineProcessing, opi, passcodes, receiptOptions, receiptPrinting, signature, standalone, surcharge, timeouts, wifiProfiles); + return Objects.hash(cardholderReceipt, connectivity, gratuities, hardware, nexo, offlineProcessing, opi, passcodes, payAtTable, payment, receiptOptions, receiptPrinting, signature, standalone, surcharge, timeouts, wifiProfiles); } @Override @@ -510,6 +566,8 @@ public String toString() { sb.append(" offlineProcessing: ").append(toIndentedString(offlineProcessing)).append("\n"); sb.append(" opi: ").append(toIndentedString(opi)).append("\n"); sb.append(" passcodes: ").append(toIndentedString(passcodes)).append("\n"); + sb.append(" payAtTable: ").append(toIndentedString(payAtTable)).append("\n"); + sb.append(" payment: ").append(toIndentedString(payment)).append("\n"); sb.append(" receiptOptions: ").append(toIndentedString(receiptOptions)).append("\n"); sb.append(" receiptPrinting: ").append(toIndentedString(receiptPrinting)).append("\n"); sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); @@ -547,6 +605,8 @@ private String toIndentedString(Object o) { openapiFields.add("offlineProcessing"); openapiFields.add("opi"); openapiFields.add("passcodes"); + openapiFields.add("payAtTable"); + openapiFields.add("payment"); openapiFields.add("receiptOptions"); openapiFields.add("receiptPrinting"); openapiFields.add("signature"); @@ -621,6 +681,14 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.getAsJsonObject("passcodes") != null) { Passcodes.validateJsonObject(jsonObj.getAsJsonObject("passcodes")); } + // validate the optional field `payAtTable` + if (jsonObj.getAsJsonObject("payAtTable") != null) { + PayAtTable.validateJsonObject(jsonObj.getAsJsonObject("payAtTable")); + } + // validate the optional field `payment` + if (jsonObj.getAsJsonObject("payment") != null) { + Payment.validateJsonObject(jsonObj.getAsJsonObject("payment")); + } // validate the optional field `receiptOptions` if (jsonObj.getAsJsonObject("receiptOptions") != null) { ReceiptOptions.validateJsonObject(jsonObj.getAsJsonObject("receiptOptions")); diff --git a/src/main/java/com/adyen/model/management/UpdateCompanyUserRequest.java b/src/main/java/com/adyen/model/management/UpdateCompanyUserRequest.java index 02a11d622..f1d9af219 100644 --- a/src/main/java/com/adyen/model/management/UpdateCompanyUserRequest.java +++ b/src/main/java/com/adyen/model/management/UpdateCompanyUserRequest.java @@ -63,6 +63,14 @@ public class UpdateCompanyUserRequest { @SerializedName(SERIALIZED_NAME_ASSOCIATED_MERCHANT_ACCOUNTS) private List associatedMerchantAccounts = null; + public static final String SERIALIZED_NAME_AUTHN_APPS_TO_ADD = "authnAppsToAdd"; + @SerializedName(SERIALIZED_NAME_AUTHN_APPS_TO_ADD) + private List authnAppsToAdd = null; + + public static final String SERIALIZED_NAME_AUTHN_APPS_TO_REMOVE = "authnAppsToRemove"; + @SerializedName(SERIALIZED_NAME_AUTHN_APPS_TO_REMOVE) + private List authnAppsToRemove = null; + public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) private String email; @@ -164,6 +172,66 @@ public void setAssociatedMerchantAccounts(List associatedMerchantAccount } + public UpdateCompanyUserRequest authnAppsToAdd(List authnAppsToAdd) { + + this.authnAppsToAdd = authnAppsToAdd; + return this; + } + + public UpdateCompanyUserRequest addAuthnAppsToAddItem(String authnAppsToAddItem) { + if (this.authnAppsToAdd == null) { + this.authnAppsToAdd = new ArrayList<>(); + } + this.authnAppsToAdd.add(authnAppsToAddItem); + return this; + } + + /** + * Set of authn apps to add to this user + * @return authnAppsToAdd + **/ + @ApiModelProperty(value = "Set of authn apps to add to this user") + + public List getAuthnAppsToAdd() { + return authnAppsToAdd; + } + + + public void setAuthnAppsToAdd(List authnAppsToAdd) { + this.authnAppsToAdd = authnAppsToAdd; + } + + + public UpdateCompanyUserRequest authnAppsToRemove(List authnAppsToRemove) { + + this.authnAppsToRemove = authnAppsToRemove; + return this; + } + + public UpdateCompanyUserRequest addAuthnAppsToRemoveItem(String authnAppsToRemoveItem) { + if (this.authnAppsToRemove == null) { + this.authnAppsToRemove = new ArrayList<>(); + } + this.authnAppsToRemove.add(authnAppsToRemoveItem); + return this; + } + + /** + * Set of authn apps to remove from this user + * @return authnAppsToRemove + **/ + @ApiModelProperty(value = "Set of authn apps to remove from this user") + + public List getAuthnAppsToRemove() { + return authnAppsToRemove; + } + + + public void setAuthnAppsToRemove(List authnAppsToRemove) { + this.authnAppsToRemove = authnAppsToRemove; + } + + public UpdateCompanyUserRequest email(String email) { this.email = email; @@ -273,6 +341,8 @@ public boolean equals(Object o) { return Objects.equals(this.accountGroups, updateCompanyUserRequest.accountGroups) && Objects.equals(this.active, updateCompanyUserRequest.active) && Objects.equals(this.associatedMerchantAccounts, updateCompanyUserRequest.associatedMerchantAccounts) && + Objects.equals(this.authnAppsToAdd, updateCompanyUserRequest.authnAppsToAdd) && + Objects.equals(this.authnAppsToRemove, updateCompanyUserRequest.authnAppsToRemove) && Objects.equals(this.email, updateCompanyUserRequest.email) && Objects.equals(this.name, updateCompanyUserRequest.name) && Objects.equals(this.roles, updateCompanyUserRequest.roles) && @@ -281,7 +351,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountGroups, active, associatedMerchantAccounts, email, name, roles, timeZoneCode); + return Objects.hash(accountGroups, active, associatedMerchantAccounts, authnAppsToAdd, authnAppsToRemove, email, name, roles, timeZoneCode); } @Override @@ -291,6 +361,8 @@ public String toString() { sb.append(" accountGroups: ").append(toIndentedString(accountGroups)).append("\n"); sb.append(" active: ").append(toIndentedString(active)).append("\n"); sb.append(" associatedMerchantAccounts: ").append(toIndentedString(associatedMerchantAccounts)).append("\n"); + sb.append(" authnAppsToAdd: ").append(toIndentedString(authnAppsToAdd)).append("\n"); + sb.append(" authnAppsToRemove: ").append(toIndentedString(authnAppsToRemove)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); @@ -320,6 +392,8 @@ private String toIndentedString(Object o) { openapiFields.add("accountGroups"); openapiFields.add("active"); openapiFields.add("associatedMerchantAccounts"); + openapiFields.add("authnAppsToAdd"); + openapiFields.add("authnAppsToRemove"); openapiFields.add("email"); openapiFields.add("name"); openapiFields.add("roles"); @@ -359,6 +433,14 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("associatedMerchantAccounts") != null && !jsonObj.get("associatedMerchantAccounts").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `associatedMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("associatedMerchantAccounts").toString())); } + // ensure the json data is an array + if (jsonObj.get("authnAppsToAdd") != null && !jsonObj.get("authnAppsToAdd").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `authnAppsToAdd` to be an array in the JSON string but got `%s`", jsonObj.get("authnAppsToAdd").toString())); + } + // ensure the json data is an array + if (jsonObj.get("authnAppsToRemove") != null && !jsonObj.get("authnAppsToRemove").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `authnAppsToRemove` to be an array in the JSON string but got `%s`", jsonObj.get("authnAppsToRemove").toString())); + } // validate the optional field email if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); diff --git a/src/main/java/com/adyen/model/management/UpdateCompanyWebhookRequest.java b/src/main/java/com/adyen/model/management/UpdateCompanyWebhookRequest.java index cd77d944a..55a7b5b23 100644 --- a/src/main/java/com/adyen/model/management/UpdateCompanyWebhookRequest.java +++ b/src/main/java/com/adyen/model/management/UpdateCompanyWebhookRequest.java @@ -76,11 +76,11 @@ public class UpdateCompanyWebhookRequest { */ @JsonAdapter(CommunicationFormatEnum.Adapter.class) public enum CommunicationFormatEnum { - HTTP("HTTP"), + HTTP("http"), - JSON("JSON"), + JSON("json"), - SOAP("SOAP"); + SOAP("soap"); private String value; @@ -133,11 +133,11 @@ public CommunicationFormatEnum read(final JsonReader jsonReader) throws IOExcept */ @JsonAdapter(FilterMerchantAccountTypeEnum.Adapter.class) public enum FilterMerchantAccountTypeEnum { - EXCLUDE_LIST("EXCLUDE_LIST"), + ALLACCOUNTS("allAccounts"), - INCLUDE_ALL("INCLUDE_ALL"), + EXCLUDEACCOUNTS("excludeAccounts"), - INCLUDE_LIST("INCLUDE_LIST"); + INCLUDEACCOUNTS("includeAccounts"); private String value; @@ -253,21 +253,17 @@ public enum SslVersionEnum { SSL("SSL"), - SSLV3("SSLV3"), - - SSL_INSECURE_CIPHERS("SSL_INSECURE_CIPHERS"), + SSLV3("SSLv3"), TLS("TLS"), - TLSV1("TLSV1"), - - TLSV1_1("TLSV1_1"), + TLSV1("TLSv1"), - TLSV1_2("TLSV1_2"), + TLSV1_1("TLSv1.1"), - TLSV1_3("TLSV1_3"), + TLSV1_2("TLSv1.2"), - TLSV1_INSECURE_CIPHERS("TLSV1_INSECURE_CIPHERS"); + TLSV1_3("TLSv1.3"); private String value; @@ -442,7 +438,7 @@ public UpdateCompanyWebhookRequest communicationFormat(CommunicationFormatEnum c * Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** * @return communicationFormat **/ - @ApiModelProperty(example = "SOAP", value = "Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** ") + @ApiModelProperty(example = "soap", value = "Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** ") public CommunicationFormatEnum getCommunicationFormat() { return communicationFormat; @@ -626,7 +622,7 @@ public UpdateCompanyWebhookRequest url(String url) { * Public URL where webhooks will be sent, for example **https://www.domain.com/webhook-endpoint**. * @return url **/ - @ApiModelProperty(example = "http://www.adyen.com", required = true, value = "Public URL where webhooks will be sent, for example **https://www.domain.com/webhook-endpoint**.") + @ApiModelProperty(example = "http://www.adyen.com", value = "Public URL where webhooks will be sent, for example **https://www.domain.com/webhook-endpoint**.") public String getUrl() { return url; @@ -751,7 +747,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("url"); } /** @@ -776,13 +771,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateCompanyWebhookRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateCompanyWebhookRequest.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } // validate the optional field `additionalSettings` if (jsonObj.getAsJsonObject("additionalSettings") != null) { AdditionalSettings.validateJsonObject(jsonObj.getAsJsonObject("additionalSettings")); diff --git a/src/main/java/com/adyen/model/management/UpdateMerchantUserRequest.java b/src/main/java/com/adyen/model/management/UpdateMerchantUserRequest.java index 62607e5e0..cfe518d3c 100644 --- a/src/main/java/com/adyen/model/management/UpdateMerchantUserRequest.java +++ b/src/main/java/com/adyen/model/management/UpdateMerchantUserRequest.java @@ -59,6 +59,14 @@ public class UpdateMerchantUserRequest { @SerializedName(SERIALIZED_NAME_ACTIVE) private Boolean active; + public static final String SERIALIZED_NAME_AUTHN_APPS_TO_ADD = "authnAppsToAdd"; + @SerializedName(SERIALIZED_NAME_AUTHN_APPS_TO_ADD) + private List authnAppsToAdd = null; + + public static final String SERIALIZED_NAME_AUTHN_APPS_TO_REMOVE = "authnAppsToRemove"; + @SerializedName(SERIALIZED_NAME_AUTHN_APPS_TO_REMOVE) + private List authnAppsToRemove = null; + public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) private String email; @@ -130,6 +138,66 @@ public void setActive(Boolean active) { } + public UpdateMerchantUserRequest authnAppsToAdd(List authnAppsToAdd) { + + this.authnAppsToAdd = authnAppsToAdd; + return this; + } + + public UpdateMerchantUserRequest addAuthnAppsToAddItem(String authnAppsToAddItem) { + if (this.authnAppsToAdd == null) { + this.authnAppsToAdd = new ArrayList<>(); + } + this.authnAppsToAdd.add(authnAppsToAddItem); + return this; + } + + /** + * Set of authn apps to add to this user + * @return authnAppsToAdd + **/ + @ApiModelProperty(value = "Set of authn apps to add to this user") + + public List getAuthnAppsToAdd() { + return authnAppsToAdd; + } + + + public void setAuthnAppsToAdd(List authnAppsToAdd) { + this.authnAppsToAdd = authnAppsToAdd; + } + + + public UpdateMerchantUserRequest authnAppsToRemove(List authnAppsToRemove) { + + this.authnAppsToRemove = authnAppsToRemove; + return this; + } + + public UpdateMerchantUserRequest addAuthnAppsToRemoveItem(String authnAppsToRemoveItem) { + if (this.authnAppsToRemove == null) { + this.authnAppsToRemove = new ArrayList<>(); + } + this.authnAppsToRemove.add(authnAppsToRemoveItem); + return this; + } + + /** + * Set of authn apps to remove from this user + * @return authnAppsToRemove + **/ + @ApiModelProperty(value = "Set of authn apps to remove from this user") + + public List getAuthnAppsToRemove() { + return authnAppsToRemove; + } + + + public void setAuthnAppsToRemove(List authnAppsToRemove) { + this.authnAppsToRemove = authnAppsToRemove; + } + + public UpdateMerchantUserRequest email(String email) { this.email = email; @@ -238,6 +306,8 @@ public boolean equals(Object o) { UpdateMerchantUserRequest updateMerchantUserRequest = (UpdateMerchantUserRequest) o; return Objects.equals(this.accountGroups, updateMerchantUserRequest.accountGroups) && Objects.equals(this.active, updateMerchantUserRequest.active) && + Objects.equals(this.authnAppsToAdd, updateMerchantUserRequest.authnAppsToAdd) && + Objects.equals(this.authnAppsToRemove, updateMerchantUserRequest.authnAppsToRemove) && Objects.equals(this.email, updateMerchantUserRequest.email) && Objects.equals(this.name, updateMerchantUserRequest.name) && Objects.equals(this.roles, updateMerchantUserRequest.roles) && @@ -246,7 +316,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountGroups, active, email, name, roles, timeZoneCode); + return Objects.hash(accountGroups, active, authnAppsToAdd, authnAppsToRemove, email, name, roles, timeZoneCode); } @Override @@ -255,6 +325,8 @@ public String toString() { sb.append("class UpdateMerchantUserRequest {\n"); sb.append(" accountGroups: ").append(toIndentedString(accountGroups)).append("\n"); sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" authnAppsToAdd: ").append(toIndentedString(authnAppsToAdd)).append("\n"); + sb.append(" authnAppsToRemove: ").append(toIndentedString(authnAppsToRemove)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); @@ -283,6 +355,8 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("accountGroups"); openapiFields.add("active"); + openapiFields.add("authnAppsToAdd"); + openapiFields.add("authnAppsToRemove"); openapiFields.add("email"); openapiFields.add("name"); openapiFields.add("roles"); @@ -318,6 +392,14 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("accountGroups") != null && !jsonObj.get("accountGroups").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `accountGroups` to be an array in the JSON string but got `%s`", jsonObj.get("accountGroups").toString())); } + // ensure the json data is an array + if (jsonObj.get("authnAppsToAdd") != null && !jsonObj.get("authnAppsToAdd").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `authnAppsToAdd` to be an array in the JSON string but got `%s`", jsonObj.get("authnAppsToAdd").toString())); + } + // ensure the json data is an array + if (jsonObj.get("authnAppsToRemove") != null && !jsonObj.get("authnAppsToRemove").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `authnAppsToRemove` to be an array in the JSON string but got `%s`", jsonObj.get("authnAppsToRemove").toString())); + } // validate the optional field email if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); diff --git a/src/main/java/com/adyen/model/management/UpdateMerchantWebhookRequest.java b/src/main/java/com/adyen/model/management/UpdateMerchantWebhookRequest.java index c03bff3ea..3221c4154 100644 --- a/src/main/java/com/adyen/model/management/UpdateMerchantWebhookRequest.java +++ b/src/main/java/com/adyen/model/management/UpdateMerchantWebhookRequest.java @@ -74,11 +74,11 @@ public class UpdateMerchantWebhookRequest { */ @JsonAdapter(CommunicationFormatEnum.Adapter.class) public enum CommunicationFormatEnum { - HTTP("HTTP"), + HTTP("http"), - JSON("JSON"), + JSON("json"), - SOAP("SOAP"); + SOAP("soap"); private String value; @@ -194,21 +194,17 @@ public enum SslVersionEnum { SSL("SSL"), - SSLV3("SSLV3"), - - SSL_INSECURE_CIPHERS("SSL_INSECURE_CIPHERS"), + SSLV3("SSLv3"), TLS("TLS"), - TLSV1("TLSV1"), - - TLSV1_1("TLSV1_1"), + TLSV1("TLSv1"), - TLSV1_2("TLSV1_2"), + TLSV1_1("TLSv1.1"), - TLSV1_3("TLSV1_3"), + TLSV1_2("TLSv1.2"), - TLSV1_INSECURE_CIPHERS("TLSV1_INSECURE_CIPHERS"); + TLSV1_3("TLSv1.3"); private String value; @@ -339,7 +335,7 @@ public UpdateMerchantWebhookRequest active(Boolean active) { * Indicates if the webhook configuration is active. The field must be **true** for us to send webhooks about events related an account. * @return active **/ - @ApiModelProperty(required = true, value = "Indicates if the webhook configuration is active. The field must be **true** for us to send webhooks about events related an account.") + @ApiModelProperty(value = "Indicates if the webhook configuration is active. The field must be **true** for us to send webhooks about events related an account.") public Boolean getActive() { return active; @@ -383,7 +379,7 @@ public UpdateMerchantWebhookRequest communicationFormat(CommunicationFormatEnum * Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** * @return communicationFormat **/ - @ApiModelProperty(example = "SOAP", required = true, value = "Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** ") + @ApiModelProperty(example = "soap", value = "Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** ") public CommunicationFormatEnum getCommunicationFormat() { return communicationFormat; @@ -515,7 +511,7 @@ public UpdateMerchantWebhookRequest url(String url) { * Public URL where webhooks will be sent, for example **https://www.domain.com/webhook-endpoint**. * @return url **/ - @ApiModelProperty(example = "http://www.adyen.com", required = true, value = "Public URL where webhooks will be sent, for example **https://www.domain.com/webhook-endpoint**.") + @ApiModelProperty(example = "http://www.adyen.com", value = "Public URL where webhooks will be sent, for example **https://www.domain.com/webhook-endpoint**.") public String getUrl() { return url; @@ -634,9 +630,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("active"); - openapiRequiredFields.add("communicationFormat"); - openapiRequiredFields.add("url"); } /** @@ -661,13 +654,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateMerchantWebhookRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : UpdateMerchantWebhookRequest.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } // validate the optional field `additionalSettings` if (jsonObj.getAsJsonObject("additionalSettings") != null) { AdditionalSettings.validateJsonObject(jsonObj.getAsJsonObject("additionalSettings")); diff --git a/src/main/java/com/adyen/model/management/UpdatePaymentMethodInfo.java b/src/main/java/com/adyen/model/management/UpdatePaymentMethodInfo.java index bcbe8e605..44f91324d 100644 --- a/src/main/java/com/adyen/model/management/UpdatePaymentMethodInfo.java +++ b/src/main/java/com/adyen/model/management/UpdatePaymentMethodInfo.java @@ -71,6 +71,10 @@ public class UpdatePaymentMethodInfo { @SerializedName(SERIALIZED_NAME_SHOPPER_STATEMENT) private ShopperStatement shopperStatement; + public static final String SERIALIZED_NAME_STORE_IDS = "storeIds"; + @SerializedName(SERIALIZED_NAME_STORE_IDS) + private List storeIds = null; + public UpdatePaymentMethodInfo() { } @@ -208,6 +212,36 @@ public void setShopperStatement(ShopperStatement shopperStatement) { } + public UpdatePaymentMethodInfo storeIds(List storeIds) { + + this.storeIds = storeIds; + return this; + } + + public UpdatePaymentMethodInfo addStoreIdsItem(String storeIdsItem) { + if (this.storeIds == null) { + this.storeIds = new ArrayList<>(); + } + this.storeIds.add(storeIdsItem); + return this; + } + + /** + * The list of stores for this payment method + * @return storeIds + **/ + @ApiModelProperty(value = "The list of stores for this payment method") + + public List getStoreIds() { + return storeIds; + } + + + public void setStoreIds(List storeIds) { + this.storeIds = storeIds; + } + + @Override public boolean equals(Object o) { @@ -222,12 +256,13 @@ public boolean equals(Object o) { Objects.equals(this.currencies, updatePaymentMethodInfo.currencies) && Objects.equals(this.customRoutingFlags, updatePaymentMethodInfo.customRoutingFlags) && Objects.equals(this.enabled, updatePaymentMethodInfo.enabled) && - Objects.equals(this.shopperStatement, updatePaymentMethodInfo.shopperStatement); + Objects.equals(this.shopperStatement, updatePaymentMethodInfo.shopperStatement) && + Objects.equals(this.storeIds, updatePaymentMethodInfo.storeIds); } @Override public int hashCode() { - return Objects.hash(countries, currencies, customRoutingFlags, enabled, shopperStatement); + return Objects.hash(countries, currencies, customRoutingFlags, enabled, shopperStatement, storeIds); } @Override @@ -239,6 +274,7 @@ public String toString() { sb.append(" customRoutingFlags: ").append(toIndentedString(customRoutingFlags)).append("\n"); sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); sb.append(" shopperStatement: ").append(toIndentedString(shopperStatement)).append("\n"); + sb.append(" storeIds: ").append(toIndentedString(storeIds)).append("\n"); sb.append("}"); return sb.toString(); } @@ -266,6 +302,7 @@ private String toIndentedString(Object o) { openapiFields.add("customRoutingFlags"); openapiFields.add("enabled"); openapiFields.add("shopperStatement"); + openapiFields.add("storeIds"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -309,6 +346,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.getAsJsonObject("shopperStatement") != null) { ShopperStatement.validateJsonObject(jsonObj.getAsJsonObject("shopperStatement")); } + // ensure the json data is an array + if (jsonObj.get("storeIds") != null && !jsonObj.get("storeIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `storeIds` to be an array in the JSON string but got `%s`", jsonObj.get("storeIds").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/adyen/model/management/Url.java b/src/main/java/com/adyen/model/management/Url.java index 08ab69fdc..59ae4f3a1 100644 --- a/src/main/java/com/adyen/model/management/Url.java +++ b/src/main/java/com/adyen/model/management/Url.java @@ -48,6 +48,10 @@ */ public class Url { + public static final String SERIALIZED_NAME_ENCRYPTED = "encrypted"; + @SerializedName(SERIALIZED_NAME_ENCRYPTED) + private Boolean encrypted; + public static final String SERIALIZED_NAME_PASSWORD = "password"; @SerializedName(SERIALIZED_NAME_PASSWORD) private String password; @@ -63,6 +67,28 @@ public class Url { public Url() { } + public Url encrypted(Boolean encrypted) { + + this.encrypted = encrypted; + return this; + } + + /** + * Indicates if the message sent to this URL should be encrypted. + * @return encrypted + **/ + @ApiModelProperty(value = "Indicates if the message sent to this URL should be encrypted.") + + public Boolean getEncrypted() { + return encrypted; + } + + + public void setEncrypted(Boolean encrypted) { + this.encrypted = encrypted; + } + + public Url password(String password) { this.password = password; @@ -139,20 +165,22 @@ public boolean equals(Object o) { return false; } Url url = (Url) o; - return Objects.equals(this.password, url.password) && + return Objects.equals(this.encrypted, url.encrypted) && + Objects.equals(this.password, url.password) && Objects.equals(this.url, url.url) && Objects.equals(this.username, url.username); } @Override public int hashCode() { - return Objects.hash(password, url, username); + return Objects.hash(encrypted, password, url, username); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Url {\n"); + sb.append(" encrypted: ").append(toIndentedString(encrypted)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); sb.append(" url: ").append(toIndentedString(url)).append("\n"); sb.append(" username: ").append(toIndentedString(username)).append("\n"); @@ -178,6 +206,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("encrypted"); openapiFields.add("password"); openapiFields.add("url"); openapiFields.add("username"); diff --git a/src/main/java/com/adyen/model/management/User.java b/src/main/java/com/adyen/model/management/User.java index 0cba4878d..714812ed9 100644 --- a/src/main/java/com/adyen/model/management/User.java +++ b/src/main/java/com/adyen/model/management/User.java @@ -64,6 +64,10 @@ public class User { @SerializedName(SERIALIZED_NAME_ACTIVE) private Boolean active; + public static final String SERIALIZED_NAME_AUTHN_APPS = "authnApps"; + @SerializedName(SERIALIZED_NAME_AUTHN_APPS) + private List authnApps = null; + public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) private String email; @@ -165,6 +169,36 @@ public void setActive(Boolean active) { } + public User authnApps(List authnApps) { + + this.authnApps = authnApps; + return this; + } + + public User addAuthnAppsItem(String authnAppsItem) { + if (this.authnApps == null) { + this.authnApps = new ArrayList<>(); + } + this.authnApps.add(authnAppsItem); + return this; + } + + /** + * Set of authn apps available to this user + * @return authnApps + **/ + @ApiModelProperty(value = "Set of authn apps available to this user") + + public List getAuthnApps() { + return authnApps; + } + + + public void setAuthnApps(List authnApps) { + this.authnApps = authnApps; + } + + public User email(String email) { this.email = email; @@ -315,6 +349,7 @@ public boolean equals(Object o) { return Objects.equals(this.links, user.links) && Objects.equals(this.accountGroups, user.accountGroups) && Objects.equals(this.active, user.active) && + Objects.equals(this.authnApps, user.authnApps) && Objects.equals(this.email, user.email) && Objects.equals(this.id, user.id) && Objects.equals(this.name, user.name) && @@ -325,7 +360,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(links, accountGroups, active, email, id, name, roles, timeZoneCode, username); + return Objects.hash(links, accountGroups, active, authnApps, email, id, name, roles, timeZoneCode, username); } @Override @@ -335,6 +370,7 @@ public String toString() { sb.append(" links: ").append(toIndentedString(links)).append("\n"); sb.append(" accountGroups: ").append(toIndentedString(accountGroups)).append("\n"); sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" authnApps: ").append(toIndentedString(authnApps)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); @@ -366,6 +402,7 @@ private String toIndentedString(Object o) { openapiFields.add("_links"); openapiFields.add("accountGroups"); openapiFields.add("active"); + openapiFields.add("authnApps"); openapiFields.add("email"); openapiFields.add("id"); openapiFields.add("name"); @@ -419,6 +456,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("accountGroups") != null && !jsonObj.get("accountGroups").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `accountGroups` to be an array in the JSON string but got `%s`", jsonObj.get("accountGroups").toString())); } + // ensure the json data is an array + if (jsonObj.get("authnApps") != null && !jsonObj.get("authnApps").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `authnApps` to be an array in the JSON string but got `%s`", jsonObj.get("authnApps").toString())); + } // validate the optional field email if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); diff --git a/src/main/java/com/adyen/model/balanceplatform/RemediatingAction.java b/src/main/java/com/adyen/model/management/VippsInfo.java similarity index 51% rename from src/main/java/com/adyen/model/balanceplatform/RemediatingAction.java rename to src/main/java/com/adyen/model/management/VippsInfo.java index 873a52dce..a5fdaf0ae 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RemediatingAction.java +++ b/src/main/java/com/adyen/model/management/VippsInfo.java @@ -1,7 +1,7 @@ /* - * Configuration API + * Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 1 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,7 +10,7 @@ */ -package com.adyen.model.balanceplatform; +package com.adyen.model.management; import java.util.Objects; import java.util.Arrays; @@ -41,65 +41,65 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.balanceplatform.JSON; +import com.adyen.model.management.JSON; /** - * RemediatingAction + * VippsInfo */ -public class RemediatingAction { - public static final String SERIALIZED_NAME_CODE = "code"; - @SerializedName(SERIALIZED_NAME_CODE) - private String code; +public class VippsInfo { + public static final String SERIALIZED_NAME_LOGO = "logo"; + @SerializedName(SERIALIZED_NAME_LOGO) + private String logo; - public static final String SERIALIZED_NAME_MESSAGE = "message"; - @SerializedName(SERIALIZED_NAME_MESSAGE) - private String message; + public static final String SERIALIZED_NAME_SUBSCRIPTION_CANCEL_URL = "subscriptionCancelUrl"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION_CANCEL_URL) + private String subscriptionCancelUrl; - public RemediatingAction() { + public VippsInfo() { } - public RemediatingAction code(String code) { + public VippsInfo logo(String logo) { - this.code = code; + this.logo = logo; return this; } /** - * The remediating action code. - * @return code + * Vipps logo. Format: Base64-encoded string. + * @return logo **/ - @ApiModelProperty(value = "The remediating action code.") + @ApiModelProperty(required = true, value = "Vipps logo. Format: Base64-encoded string.") - public String getCode() { - return code; + public String getLogo() { + return logo; } - public void setCode(String code) { - this.code = code; + public void setLogo(String logo) { + this.logo = logo; } - public RemediatingAction message(String message) { + public VippsInfo subscriptionCancelUrl(String subscriptionCancelUrl) { - this.message = message; + this.subscriptionCancelUrl = subscriptionCancelUrl; return this; } /** - * A description of how you can resolve the verification error. - * @return message + * Vipps subscription cancel url + * @return subscriptionCancelUrl **/ - @ApiModelProperty(value = "A description of how you can resolve the verification error.") + @ApiModelProperty(value = "Vipps subscription cancel url") - public String getMessage() { - return message; + public String getSubscriptionCancelUrl() { + return subscriptionCancelUrl; } - public void setMessage(String message) { - this.message = message; + public void setSubscriptionCancelUrl(String subscriptionCancelUrl) { + this.subscriptionCancelUrl = subscriptionCancelUrl; } @@ -112,22 +112,22 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - RemediatingAction remediatingAction = (RemediatingAction) o; - return Objects.equals(this.code, remediatingAction.code) && - Objects.equals(this.message, remediatingAction.message); + VippsInfo vippsInfo = (VippsInfo) o; + return Objects.equals(this.logo, vippsInfo.logo) && + Objects.equals(this.subscriptionCancelUrl, vippsInfo.subscriptionCancelUrl); } @Override public int hashCode() { - return Objects.hash(code, message); + return Objects.hash(logo, subscriptionCancelUrl); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class RemediatingAction {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("class VippsInfo {\n"); + sb.append(" logo: ").append(toIndentedString(logo)).append("\n"); + sb.append(" subscriptionCancelUrl: ").append(toIndentedString(subscriptionCancelUrl)).append("\n"); sb.append("}"); return sb.toString(); } @@ -150,42 +150,50 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("code"); - openapiFields.add("message"); + openapiFields.add("logo"); + openapiFields.add("subscriptionCancelUrl"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("logo"); } /** * Validates the JSON Object and throws an exception if issues found * * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to RemediatingAction + * @throws IOException if the JSON Object is invalid with respect to VippsInfo */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { - if (RemediatingAction.openapiRequiredFields.isEmpty()) { + if (VippsInfo.openapiRequiredFields.isEmpty()) { return; } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in RemediatingAction is not found in the empty JSON string", RemediatingAction.openapiRequiredFields.toString())); + throw new IllegalArgumentException(String.format("The required field(s) %s in VippsInfo is not found in the empty JSON string", VippsInfo.openapiRequiredFields.toString())); } } Set> entries = jsonObj.entrySet(); // check to see if the JSON string contains additional fields for (Entry entry : entries) { - if (!RemediatingAction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RemediatingAction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + if (!VippsInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VippsInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - // validate the optional field code - if (jsonObj.get("code") != null && !jsonObj.get("code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : VippsInfo.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field logo + if (jsonObj.get("logo") != null && !jsonObj.get("logo").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo").toString())); } - // validate the optional field message - if (jsonObj.get("message") != null && !jsonObj.get("message").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + // validate the optional field subscriptionCancelUrl + if (jsonObj.get("subscriptionCancelUrl") != null && !jsonObj.get("subscriptionCancelUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `subscriptionCancelUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscriptionCancelUrl").toString())); } } @@ -193,22 +201,22 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!RemediatingAction.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RemediatingAction' and its subtypes + if (!VippsInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VippsInfo' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(RemediatingAction.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VippsInfo.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, RemediatingAction value) throws IOException { + public void write(JsonWriter out, VippsInfo value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public RemediatingAction read(JsonReader in) throws IOException { + public VippsInfo read(JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); return thisAdapter.fromJsonTree(jsonObj); @@ -219,18 +227,18 @@ public RemediatingAction read(JsonReader in) throws IOException { } /** - * Create an instance of RemediatingAction given an JSON string + * Create an instance of VippsInfo given an JSON string * * @param jsonString JSON string - * @return An instance of RemediatingAction - * @throws IOException if the JSON string is invalid with respect to RemediatingAction + * @return An instance of VippsInfo + * @throws IOException if the JSON string is invalid with respect to VippsInfo */ - public static RemediatingAction fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, RemediatingAction.class); + public static VippsInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VippsInfo.class); } /** - * Convert an instance of RemediatingAction to an JSON string + * Convert an instance of VippsInfo to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/adyen/model/management/Webhook.java b/src/main/java/com/adyen/model/management/Webhook.java index 2b7727b71..cdf2cca50 100644 --- a/src/main/java/com/adyen/model/management/Webhook.java +++ b/src/main/java/com/adyen/model/management/Webhook.java @@ -89,11 +89,11 @@ public class Webhook { */ @JsonAdapter(CommunicationFormatEnum.Adapter.class) public enum CommunicationFormatEnum { - HTTP("HTTP"), + HTTP("http"), - JSON("JSON"), + JSON("json"), - SOAP("SOAP"); + SOAP("soap"); private String value; @@ -146,11 +146,11 @@ public CommunicationFormatEnum read(final JsonReader jsonReader) throws IOExcept */ @JsonAdapter(FilterMerchantAccountTypeEnum.Adapter.class) public enum FilterMerchantAccountTypeEnum { - EXCLUDE_LIST("EXCLUDE_LIST"), + ALLACCOUNTS("allAccounts"), - INCLUDE_ALL("INCLUDE_ALL"), + EXCLUDEACCOUNTS("excludeAccounts"), - INCLUDE_LIST("INCLUDE_LIST"); + INCLUDEACCOUNTS("includeAccounts"); private String value; @@ -278,21 +278,17 @@ public enum SslVersionEnum { SSL("SSL"), - SSLV3("SSLV3"), - - SSL_INSECURE_CIPHERS("SSL_INSECURE_CIPHERS"), + SSLV3("SSLv3"), TLS("TLS"), - TLSV1("TLSV1"), - - TLSV1_1("TLSV1_1"), + TLSV1("TLSv1"), - TLSV1_2("TLSV1_2"), + TLSV1_1("TLSv1.1"), - TLSV1_3("TLSV1_3"), + TLSV1_2("TLSv1.2"), - TLSV1_INSECURE_CIPHERS("TLSV1_INSECURE_CIPHERS"); + TLSV1_3("TLSv1.3"); private String value; @@ -537,7 +533,7 @@ public Webhook communicationFormat(CommunicationFormatEnum communicationFormat) * Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** * @return communicationFormat **/ - @ApiModelProperty(example = "SOAP", required = true, value = "Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** ") + @ApiModelProperty(example = "soap", required = true, value = "Format or protocol for receiving webhooks. Possible values: * **soap** * **http** * **json** ") public CommunicationFormatEnum getCommunicationFormat() { return communicationFormat; diff --git a/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java index 0fbaa83dd..c74699123 100644 --- a/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java @@ -52,6 +52,57 @@ public class CALocalAccountIdentification { @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) private String accountNumber; + /** + * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + */ + @JsonAdapter(AccountTypeEnum.Adapter.class) + public enum AccountTypeEnum { + CHECKING("checking"), + + SAVINGS("savings"); + + private String value; + + AccountTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AccountTypeEnum fromValue(String value) { + for (AccountTypeEnum b : AccountTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AccountTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AccountTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AccountTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ACCOUNT_TYPE = "accountType"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_TYPE) + private AccountTypeEnum accountType = AccountTypeEnum.CHECKING; + public static final String SERIALIZED_NAME_INSTITUTION_NUMBER = "institutionNumber"; @SerializedName(SERIALIZED_NAME_INSTITUTION_NUMBER) private String institutionNumber; @@ -134,6 +185,28 @@ public void setAccountNumber(String accountNumber) { } + public CALocalAccountIdentification accountType(AccountTypeEnum accountType) { + + this.accountType = accountType; + return this; + } + + /** + * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * @return accountType + **/ + @ApiModelProperty(value = "The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**.") + + public AccountTypeEnum getAccountType() { + return accountType; + } + + + public void setAccountType(AccountTypeEnum accountType) { + this.accountType = accountType; + } + + public CALocalAccountIdentification institutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; @@ -211,6 +284,7 @@ public boolean equals(Object o) { } CALocalAccountIdentification caLocalAccountIdentification = (CALocalAccountIdentification) o; return Objects.equals(this.accountNumber, caLocalAccountIdentification.accountNumber) && + Objects.equals(this.accountType, caLocalAccountIdentification.accountType) && Objects.equals(this.institutionNumber, caLocalAccountIdentification.institutionNumber) && Objects.equals(this.transitNumber, caLocalAccountIdentification.transitNumber) && Objects.equals(this.type, caLocalAccountIdentification.type); @@ -218,7 +292,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountNumber, institutionNumber, transitNumber, type); + return Objects.hash(accountNumber, accountType, institutionNumber, transitNumber, type); } @Override @@ -226,6 +300,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CALocalAccountIdentification {\n"); sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); sb.append(" institutionNumber: ").append(toIndentedString(institutionNumber)).append("\n"); sb.append(" transitNumber: ").append(toIndentedString(transitNumber)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); @@ -252,6 +327,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("accountNumber"); + openapiFields.add("accountType"); openapiFields.add("institutionNumber"); openapiFields.add("transitNumber"); openapiFields.add("type"); @@ -297,6 +373,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); } + // ensure the field accountType can be parsed to an enum value + if (jsonObj.get("accountType") != null) { + if(!jsonObj.get("accountType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountType").toString())); + } + AccountTypeEnum.fromValue(jsonObj.get("accountType").getAsString()); + } // validate the optional field institutionNumber if (jsonObj.get("institutionNumber") != null && !jsonObj.get("institutionNumber").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `institutionNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("institutionNumber").toString())); diff --git a/src/main/java/com/adyen/model/transfers/PartyIdentification2.java b/src/main/java/com/adyen/model/transfers/PartyIdentification2.java index 7121dca4b..9ce8f5703 100644 --- a/src/main/java/com/adyen/model/transfers/PartyIdentification2.java +++ b/src/main/java/com/adyen/model/transfers/PartyIdentification2.java @@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.LocalDate; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -53,6 +54,10 @@ public class PartyIdentification2 { @SerializedName(SERIALIZED_NAME_ADDRESS) private Address2 address; + public static final String SERIALIZED_NAME_DATE_OF_BIRTH = "dateOfBirth"; + @SerializedName(SERIALIZED_NAME_DATE_OF_BIRTH) + private LocalDate dateOfBirth; + public static final String SERIALIZED_NAME_FIRST_NAME = "firstName"; @SerializedName(SERIALIZED_NAME_FIRST_NAME) private String firstName; @@ -143,6 +148,28 @@ public void setAddress(Address2 address) { } + public PartyIdentification2 dateOfBirth(LocalDate dateOfBirth) { + + this.dateOfBirth = dateOfBirth; + return this; + } + + /** + * The date of birth of the individual. Format: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD Allowed only when `type` is **individual**. + * @return dateOfBirth + **/ + @ApiModelProperty(value = "The date of birth of the individual. Format: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD Allowed only when `type` is **individual**.") + + public LocalDate getDateOfBirth() { + return dateOfBirth; + } + + + public void setDateOfBirth(LocalDate dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + public PartyIdentification2 firstName(String firstName) { this.firstName = firstName; @@ -150,10 +177,10 @@ public PartyIdentification2 firstName(String firstName) { } /** - * First name of the individual. Required when `type` is **individual**. + * First name of the individual. Allowed only when `type` is **individual**. * @return firstName **/ - @ApiModelProperty(value = "First name of the individual. Required when `type` is **individual**.") + @ApiModelProperty(value = "First name of the individual. Allowed only when `type` is **individual**.") public String getFirstName() { return firstName; @@ -194,10 +221,10 @@ public PartyIdentification2 lastName(String lastName) { } /** - * Last name of the individual. Required when `type` is **individual**. + * Last name of the individual. Allowed only when `type` is **individual**. * @return lastName **/ - @ApiModelProperty(value = "Last name of the individual. Required when `type` is **individual**.") + @ApiModelProperty(value = "Last name of the individual. Allowed only when `type` is **individual**.") public String getLastName() { return lastName; @@ -242,6 +269,7 @@ public boolean equals(Object o) { } PartyIdentification2 partyIdentification2 = (PartyIdentification2) o; return Objects.equals(this.address, partyIdentification2.address) && + Objects.equals(this.dateOfBirth, partyIdentification2.dateOfBirth) && Objects.equals(this.firstName, partyIdentification2.firstName) && Objects.equals(this.fullName, partyIdentification2.fullName) && Objects.equals(this.lastName, partyIdentification2.lastName) && @@ -250,7 +278,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(address, firstName, fullName, lastName, type); + return Objects.hash(address, dateOfBirth, firstName, fullName, lastName, type); } @Override @@ -258,6 +286,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PartyIdentification2 {\n"); sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" dateOfBirth: ").append(toIndentedString(dateOfBirth)).append("\n"); sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); @@ -285,6 +314,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("address"); + openapiFields.add("dateOfBirth"); openapiFields.add("firstName"); openapiFields.add("fullName"); openapiFields.add("lastName"); diff --git a/src/main/java/com/adyen/model/transfers/Transfer.java b/src/main/java/com/adyen/model/transfers/Transfer.java index 5bacaf170..a0db052b6 100644 --- a/src/main/java/com/adyen/model/transfers/Transfer.java +++ b/src/main/java/com/adyen/model/transfers/Transfer.java @@ -246,7 +246,7 @@ public PriorityEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(ReasonEnum.Adapter.class) public enum ReasonEnum { - AMOUNTLIMITEXCEDED("amountLimitExceded"), + AMOUNTLIMITEXCEEDED("amountLimitExceeded"), APPROVED("approved"), @@ -327,6 +327,8 @@ public ReasonEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(StatusEnum.Adapter.class) public enum StatusEnum { + APPROVALPENDING("approvalPending"), + ATMWITHDRAWAL("atmWithdrawal"), ATMWITHDRAWALREVERSALPENDING("atmWithdrawalReversalPending"), diff --git a/src/test/java/com/adyen/BalancePlatformTest.java b/src/test/java/com/adyen/BalancePlatformTest.java index 3ca95e76b..84de6ebb9 100644 --- a/src/test/java/com/adyen/BalancePlatformTest.java +++ b/src/test/java/com/adyen/BalancePlatformTest.java @@ -254,8 +254,8 @@ public void PaymentInstrumentsCreateTest() throws Exception { " \"issuingCountryCode\": \"NL\"\n" + "}"); PaymentInstrument response = service.create(request); - assertEquals("PI322LJ223222B5DJS7CD9LWL", response.getId()); - assertEquals("BA3227C223222B5CTBLR8BWJB", response.getBalanceAccountId()); + assertEquals("PI32272223222C5GXTDWH3TTN", response.getId()); + assertEquals("BA3227C223222B5FG88S28BGN", response.getBalanceAccountId()); } @Test @@ -263,8 +263,8 @@ public void PaymentInstrumentsRetrieveTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/PaymentInstrument.json"); PaymentInstruments service = new PaymentInstruments(client); PaymentInstrument response = service.retrieve("PI322LJ223222B5DJS7CD9LWL"); - assertEquals("PI322LJ223222B5DJS7CD9LWL", response.getId()); - assertEquals("BA3227C223222B5CTBLR8BWJB", response.getBalanceAccountId()); + assertEquals("PI32272223222C5GXTDWH3TTN", response.getId()); + assertEquals("BA3227C223222B5FG88S28BGN", response.getBalanceAccountId()); } @Test @@ -275,8 +275,8 @@ public void PaymentInstrumentsUpdateTest() throws Exception { " \"balanceAccountId\": \"BA32272223222B5CM82WL892M\"\n" + "}"); PaymentInstrument response = service.update("PI322LJ223222B5DJS7CD9LWL", request); - assertEquals("PI322LJ223222B5DJS7CD9LWL", response.getId()); - assertEquals("BA3227C223222B5CTBLR8BWJB", response.getBalanceAccountId()); + assertEquals("PI32272223222C5GXTDWH3TTN", response.getId()); + assertEquals("BA3227C223222B5FG88S28BGN", response.getBalanceAccountId()); } @Test diff --git a/src/test/resources/mocks/balancePlatform/PaymentInstrument.json b/src/test/resources/mocks/balancePlatform/PaymentInstrument.json index 0f384477a..fb750a23b 100644 --- a/src/test/resources/mocks/balancePlatform/PaymentInstrument.json +++ b/src/test/resources/mocks/balancePlatform/PaymentInstrument.json @@ -1,10 +1,22 @@ { - "balanceAccountId": "BA3227C223222B5CTBLR8BWJB", + "balanceAccountId": "BA3227C223222B5FG88S28BGN", + "description": "My test card", "issuingCountryCode": "NL", "status": "active", - "type": "bankAccount", - "bankAccount": { - "iban": "NL20ADYB2017000035" + "type": "card", + "card": { + "brand": "mc", + "brandVariant": "mcdebit", + "cardholderName": "Simon Hopper", + "formFactor": "virtual", + "bin": "555544", + "cvc": "136", + "expiration": { + "month": "11", + "year": "2025" + }, + "lastFour": "3703", + "number": "5555444411213703" }, - "id": "PI322LJ223222B5DJS7CD9LWL" + "id": "PI32272223222C5GXTDWH3TTN" } \ No newline at end of file From 5175b410cd91c99164b11b17ddecf87cb3854ac9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 10:15:06 +0200 Subject: [PATCH 03/32] Update dependency jakarta.ws.rs:jakarta.ws.rs-api to v3 (#997) * Update dependency jakarta.ws.rs:jakarta.ws.rs-api to v3 * adjusted templates and generated models again * generate new models.. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jillingk <93914435+jillingk@users.noreply.github.com> --- pom.xml | 2 +- .../com/adyen/model/balanceplatform/AbstractOpenApiSchema.java | 2 +- ...untIdentificationValidationRequestAccountIdentification.java | 2 +- .../model/balanceplatform/PaymentInstrumentBankAccount.java | 2 +- .../model/balanceplatform/SweepConfigurationV2Schedule.java | 2 +- .../java/com/adyen/model/binlookup/AbstractOpenApiSchema.java | 2 +- .../java/com/adyen/model/checkout/AbstractOpenApiSchema.java | 2 +- .../model/checkout/PaymentDonationRequestPaymentMethod.java | 2 +- .../java/com/adyen/model/checkout/PaymentResponseAction.java | 2 +- .../model/legalentitymanagement/AbstractOpenApiSchema.java | 2 +- .../java/com/adyen/model/management/AbstractOpenApiSchema.java | 2 +- .../management/ScheduleTerminalActionsRequestActionDetails.java | 2 +- .../java/com/adyen/model/payments/AbstractOpenApiSchema.java | 2 +- src/main/java/com/adyen/model/payout/AbstractOpenApiSchema.java | 2 +- .../java/com/adyen/model/recurring/AbstractOpenApiSchema.java | 2 +- .../java/com/adyen/model/transfers/AbstractOpenApiSchema.java | 2 +- .../model/transfers/BankAccountV3AccountIdentification.java | 2 +- templates/libraries/okhttp-gson/AbstractOpenApiSchema.mustache | 2 +- templates/libraries/okhttp-gson/oneof_model.mustache | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index a99f4773c..edd4dfb92 100644 --- a/pom.xml +++ b/pom.xml @@ -225,7 +225,7 @@ jakarta.ws.rs jakarta.ws.rs-api - 2.1.6 + 3.1.0 compile diff --git a/src/main/java/com/adyen/model/balanceplatform/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/balanceplatform/AbstractOpenApiSchema.java index ae8e8bc6d..ac17c0704 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/balanceplatform/AbstractOpenApiSchema.java @@ -15,7 +15,7 @@ import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java index 1050fc9f4..c4535ff64 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java @@ -36,7 +36,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; import java.io.IOException; import java.lang.reflect.Type; diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java index 0ead638d3..b73c62419 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java @@ -25,7 +25,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; import java.io.IOException; import java.lang.reflect.Type; diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java index 577d2ee7c..9e361ec2d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java @@ -25,7 +25,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; import java.io.IOException; import java.lang.reflect.Type; diff --git a/src/main/java/com/adyen/model/binlookup/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/binlookup/AbstractOpenApiSchema.java index 476deaf80..5b8922732 100644 --- a/src/main/java/com/adyen/model/binlookup/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/binlookup/AbstractOpenApiSchema.java @@ -15,7 +15,7 @@ import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec diff --git a/src/main/java/com/adyen/model/checkout/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/checkout/AbstractOpenApiSchema.java index 1143b5be7..7209c1e5a 100644 --- a/src/main/java/com/adyen/model/checkout/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/checkout/AbstractOpenApiSchema.java @@ -15,7 +15,7 @@ import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec diff --git a/src/main/java/com/adyen/model/checkout/PaymentDonationRequestPaymentMethod.java b/src/main/java/com/adyen/model/checkout/PaymentDonationRequestPaymentMethod.java index 64832ead5..2964dce4b 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDonationRequestPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDonationRequestPaymentMethod.java @@ -62,7 +62,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; import java.io.IOException; import java.lang.reflect.Type; diff --git a/src/main/java/com/adyen/model/checkout/PaymentResponseAction.java b/src/main/java/com/adyen/model/checkout/PaymentResponseAction.java index 02506aeb4..0d864b3f6 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentResponseAction.java +++ b/src/main/java/com/adyen/model/checkout/PaymentResponseAction.java @@ -34,7 +34,7 @@ import java.util.List; import java.util.Map; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; import java.io.IOException; import java.lang.reflect.Type; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/legalentitymanagement/AbstractOpenApiSchema.java index f3c2b9e84..d67b305e3 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AbstractOpenApiSchema.java @@ -15,7 +15,7 @@ import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec diff --git a/src/main/java/com/adyen/model/management/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/management/AbstractOpenApiSchema.java index 6ffedb18e..7077bd0cf 100644 --- a/src/main/java/com/adyen/model/management/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/management/AbstractOpenApiSchema.java @@ -15,7 +15,7 @@ import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec diff --git a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java index d1d780337..2d3777223 100644 --- a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java +++ b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java @@ -28,7 +28,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; import java.io.IOException; import java.lang.reflect.Type; diff --git a/src/main/java/com/adyen/model/payments/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/payments/AbstractOpenApiSchema.java index 4b6c04b8d..80e05a994 100644 --- a/src/main/java/com/adyen/model/payments/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/payments/AbstractOpenApiSchema.java @@ -15,7 +15,7 @@ import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec diff --git a/src/main/java/com/adyen/model/payout/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/payout/AbstractOpenApiSchema.java index a17cb1bdd..8de6df217 100644 --- a/src/main/java/com/adyen/model/payout/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/payout/AbstractOpenApiSchema.java @@ -15,7 +15,7 @@ import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec diff --git a/src/main/java/com/adyen/model/recurring/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/recurring/AbstractOpenApiSchema.java index f2ba7fb11..a85f12092 100644 --- a/src/main/java/com/adyen/model/recurring/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/recurring/AbstractOpenApiSchema.java @@ -15,7 +15,7 @@ import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec diff --git a/src/main/java/com/adyen/model/transfers/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/transfers/AbstractOpenApiSchema.java index 83f19abbf..6c7266e5b 100644 --- a/src/main/java/com/adyen/model/transfers/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/transfers/AbstractOpenApiSchema.java @@ -15,7 +15,7 @@ import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec diff --git a/src/main/java/com/adyen/model/transfers/BankAccountV3AccountIdentification.java b/src/main/java/com/adyen/model/transfers/BankAccountV3AccountIdentification.java index f5d0f424f..f7cbafb5e 100644 --- a/src/main/java/com/adyen/model/transfers/BankAccountV3AccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/BankAccountV3AccountIdentification.java @@ -38,7 +38,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; import java.io.IOException; import java.lang.reflect.Type; diff --git a/templates/libraries/okhttp-gson/AbstractOpenApiSchema.mustache b/templates/libraries/okhttp-gson/AbstractOpenApiSchema.mustache index 0f85519ea..f043fca26 100644 --- a/templates/libraries/okhttp-gson/AbstractOpenApiSchema.mustache +++ b/templates/libraries/okhttp-gson/AbstractOpenApiSchema.mustache @@ -5,7 +5,7 @@ package {{modelPackage}}; import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec diff --git a/templates/libraries/okhttp-gson/oneof_model.mustache b/templates/libraries/okhttp-gson/oneof_model.mustache index 8748d06be..e42f71658 100644 --- a/templates/libraries/okhttp-gson/oneof_model.mustache +++ b/templates/libraries/okhttp-gson/oneof_model.mustache @@ -1,4 +1,4 @@ -import javax.ws.rs.core.GenericType; +import jakarta.ws.rs.core.GenericType; import java.io.IOException; import java.lang.reflect.Type; From e4cd40e2762ba9e2fa2defea26453507a93c827b Mon Sep 17 00:00:00 2001 From: Beppe Catanese <1771700+gcatanese@users.noreply.github.com> Date: Thu, 13 Apr 2023 10:16:30 +0200 Subject: [PATCH 04/32] ApiException doesn't provide ApiError with error information (#992) * Deserialize JSON into ApiError object * Test deserialization with 2 different error payloads --- src/main/java/com/adyen/model/ApiError.java | 66 ++++++++++++++++++- .../com/adyen/service/resource/Resource.java | 2 + .../java/com/adyen/service/ResourceTest.java | 37 +++++++++++ .../response-validation-error-rfc7807.json | 14 ++++ .../mocks/response-validation-error.json | 7 ++ 5 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 src/test/resources/mocks/response-validation-error-rfc7807.json create mode 100644 src/test/resources/mocks/response-validation-error.json diff --git a/src/main/java/com/adyen/model/ApiError.java b/src/main/java/com/adyen/model/ApiError.java index 9b7ac3b0d..989e11a44 100644 --- a/src/main/java/com/adyen/model/ApiError.java +++ b/src/main/java/com/adyen/model/ApiError.java @@ -21,11 +21,14 @@ package com.adyen.model; import com.adyen.model.marketpay.ErrorFieldType; +import com.google.gson.*; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; import java.util.List; - import static com.adyen.util.Util.toIndentedString; /** @@ -98,6 +101,67 @@ public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; } + /** + * Create an instance of ApiError given an JSON string + * @param jsonString + * @return + * @throws IOException + */ + public static ApiError fromJson(String jsonString) throws IOException { + + Gson gson = new GsonBuilder() + .registerTypeAdapter(ApiError.class, new ApiErrorAdapter()) + .create(); + + return gson.fromJson(jsonString, ApiError.class); + } + + // custom deserialization of ApiError to support both RFC7807 format and the existing ServiceError schema + static class ApiErrorAdapter extends TypeAdapter { + private final Gson gson = new Gson(); + + @Override + public void write(JsonWriter out, ApiError value) throws IOException { + // nothing to do + } + + @Override + public ApiError read(JsonReader jsonReader) throws IOException { + ApiError apiError; + + JsonObject jsonObject = gson.fromJson(jsonReader, JsonObject.class); + JsonElement typeJsonElement = jsonObject.get("type"); + + if (typeJsonElement != null) { + // convert RFC7807 payload to ApiError + apiError = new ApiError(); + apiError.errorType = getStringValue(jsonObject, "type"); + apiError.status = getIntValue(jsonObject, "status"); + apiError.message = getStringValue(jsonObject, "detail"); + apiError.invalidFields = getListValue(jsonObject, "invalidFields"); + apiError.errorCode = getStringValue(jsonObject, "errorCode"); + } else { + // map ServiceError to ApiError + apiError = gson.fromJson(jsonObject, ApiError.class); + } + + return apiError; + } + + String getStringValue(JsonObject jsonObject, String field) { + return jsonObject.get(field) != null ? jsonObject.get(field).getAsString() : null; + } + + Integer getIntValue(JsonObject jsonObject, String field) { + return jsonObject.get(field) != null ? jsonObject.get(field).getAsInt() : null; + } + + List getListValue(JsonObject jsonObject, String field) { + return jsonObject.get(field) != null ? jsonObject.get(field).getAsJsonArray().asList() : null; + } + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/src/main/java/com/adyen/service/resource/Resource.java b/src/main/java/com/adyen/service/resource/Resource.java index fff5e218a..8dc2e1e0f 100644 --- a/src/main/java/com/adyen/service/resource/Resource.java +++ b/src/main/java/com/adyen/service/resource/Resource.java @@ -25,6 +25,7 @@ import com.adyen.constants.ApiConstants; import com.adyen.httpclient.ClientInterface; import com.adyen.httpclient.HTTPClientException; +import com.adyen.model.ApiError; import com.adyen.model.RequestOptions; import com.adyen.service.exception.ApiException; import com.google.gson.Gson; @@ -113,6 +114,7 @@ public String request(String json, RequestOptions requestOptions, ApiConstants.H } catch (HTTPClientException e) { apiException = new ApiException(e.getMessage(), e.getCode(), e.getResponseHeaders()); apiException.setResponseBody(e.getResponseBody()); + apiException.setError(ApiError.fromJson(e.getResponseBody())); } throw apiException; } diff --git a/src/test/java/com/adyen/service/ResourceTest.java b/src/test/java/com/adyen/service/ResourceTest.java index 6a50377fd..d47f05743 100644 --- a/src/test/java/com/adyen/service/ResourceTest.java +++ b/src/test/java/com/adyen/service/ResourceTest.java @@ -113,4 +113,41 @@ public void testRequestException() throws IOException { assertTrue(e.getResponseBody().contains("010")); } } + + @Test + public void testValidationException() throws IOException { + Client client = createMockClientForErrors(422, "mocks/response-validation-error.json"); + + when(serviceMock.getClient()).thenReturn(client); + try { + Resource resource = new Resource(serviceMock, "", null); + String response = resource.request("request"); + + fail("Expected exception"); + } catch (ApiException e) { + assertEquals(422, e.getStatusCode()); + assertNotNull(e.getError()); + assertEquals("validation", e.getError().getErrorType()); + assertEquals("Required field 'reference' is not provided.", e.getError().getMessage()); + } + } + + @Test + public void testErrorRfc7807ValidationException() throws IOException { + Client client = createMockClientForErrors(422, "mocks/response-validation-error-rfc7807.json"); + + when(serviceMock.getClient()).thenReturn(client); + try { + Resource resource = new Resource(serviceMock, "", null); + String response = resource.request("request"); + + fail("Expected exception"); + } catch (ApiException e) { + assertEquals(422, e.getStatusCode()); + assertNotNull(e.getError()); + assertEquals("https://docs.adyen.com/errors/validation", e.getError().getErrorType()); + assertEquals("Invalid legal entity information provided", e.getError().getMessage()); + assertEquals(1, e.getError().getInvalidFields().size()); + } + } } diff --git a/src/test/resources/mocks/response-validation-error-rfc7807.json b/src/test/resources/mocks/response-validation-error-rfc7807.json new file mode 100644 index 000000000..70975c29d --- /dev/null +++ b/src/test/resources/mocks/response-validation-error-rfc7807.json @@ -0,0 +1,14 @@ +{ + "type": "https://docs.adyen.com/errors/validation", + "title": "The request is missing required fields or contains invalid data.", + "status": 422, + "detail": "Invalid legal entity information provided", + "requestId": "1234567890", + "invalidFields": [ + { + "name": "type", + "message": "Type was not provided, or was invalid. Possible values: [organization, individual, soleProprietorship, trust, unincorporatedPartnership]." + } + ], + "errorCode": "30_102" +} \ No newline at end of file diff --git a/src/test/resources/mocks/response-validation-error.json b/src/test/resources/mocks/response-validation-error.json new file mode 100644 index 000000000..6d0969622 --- /dev/null +++ b/src/test/resources/mocks/response-validation-error.json @@ -0,0 +1,7 @@ +{ + "status" : 422, + "errorCode" : "130", + "message" : "Required field 'reference' is not provided.", + "errorType" : "validation", + "pspReference" : "ABCDEFGHIJKLMNO" +} \ No newline at end of file From f2bf042db7f30e5f18ab8adce21d399b2c355e3e Mon Sep 17 00:00:00 2001 From: Christophe Maillard Date: Thu, 13 Apr 2023 10:16:54 +0200 Subject: [PATCH 05/32] fix: static initialisers to avoid side effects in the JSON constructors (#990) * fix: static initialisers to avoid side effects in the JSON constructors * Addressing CheckStyle comments --- src/main/java/com/adyen/model/balanceplatform/JSON.java | 2 +- src/main/java/com/adyen/model/binlookup/JSON.java | 2 +- src/main/java/com/adyen/model/checkout/JSON.java | 2 +- src/main/java/com/adyen/model/legalentitymanagement/JSON.java | 2 +- src/main/java/com/adyen/model/management/JSON.java | 2 +- src/main/java/com/adyen/model/payments/JSON.java | 2 +- src/main/java/com/adyen/model/payout/JSON.java | 2 +- src/main/java/com/adyen/model/recurring/JSON.java | 2 +- src/main/java/com/adyen/model/transfers/JSON.java | 2 +- src/main/java/com/adyen/service/BinLookup.java | 2 -- src/main/java/com/adyen/service/Checkout.java | 2 -- src/main/java/com/adyen/service/Payment.java | 2 -- src/main/java/com/adyen/service/Payout.java | 2 -- src/main/java/com/adyen/service/Recurring.java | 2 -- src/main/java/com/adyen/service/Transfers.java | 2 -- .../java/com/adyen/service/balanceplatform/AccountHolders.java | 2 -- .../java/com/adyen/service/balanceplatform/BalanceAccounts.java | 2 -- src/main/java/com/adyen/service/balanceplatform/General.java | 2 -- .../adyen/service/balanceplatform/PaymentInstrumentGroups.java | 2 -- .../com/adyen/service/balanceplatform/PaymentInstruments.java | 2 -- .../com/adyen/service/balanceplatform/TransactionRules.java | 2 -- .../service/legalentitymanagement/BusinessLineService.java | 2 -- .../java/com/adyen/service/legalentitymanagement/Documents.java | 2 -- .../adyen/service/legalentitymanagement/HostedOnboarding.java | 2 -- .../com/adyen/service/legalentitymanagement/LegalEntities.java | 2 -- .../service/legalentitymanagement/TransferInstruments.java | 2 -- .../java/com/adyen/service/management/AccountCompanyLevel.java | 1 - .../java/com/adyen/service/management/AccountMerchantLevel.java | 1 - .../java/com/adyen/service/management/AccountStoreLevel.java | 1 - .../adyen/service/management/AllowedOriginsCompanyLevel.java | 1 - .../adyen/service/management/AllowedOriginsMerchantLevel.java | 1 - .../adyen/service/management/ApiCredentialsCompanyLevel.java | 1 - .../adyen/service/management/ApiCredentialsMerchantLevel.java | 1 - .../java/com/adyen/service/management/ApiKeyCompanyLevel.java | 1 - .../java/com/adyen/service/management/ApiKeyMerchantLevel.java | 1 - .../com/adyen/service/management/ClientKeyCompanyLevel.java | 1 - .../com/adyen/service/management/ClientKeyMerchantLevel.java | 1 - src/main/java/com/adyen/service/management/MyApiCredential.java | 1 - .../adyen/service/management/PaymentMethodsMerchantLevel.java | 1 - .../adyen/service/management/PayoutSettingsMerchantLevel.java | 1 - .../adyen/service/management/TerminalActionsCompanyLevel.java | 1 - .../adyen/service/management/TerminalActionsTerminalLevel.java | 1 - .../adyen/service/management/TerminalOrdersCompanyLevel.java | 1 - .../adyen/service/management/TerminalOrdersMerchantLevel.java | 1 - .../adyen/service/management/TerminalSettingsCompanyLevel.java | 1 - .../adyen/service/management/TerminalSettingsMerchantLevel.java | 1 - .../adyen/service/management/TerminalSettingsStoreLevel.java | 1 - .../adyen/service/management/TerminalSettingsTerminalLevel.java | 1 - .../com/adyen/service/management/TerminalsTerminalLevel.java | 1 - .../java/com/adyen/service/management/UsersCompanyLevel.java | 1 - .../java/com/adyen/service/management/UsersMerchantLevel.java | 1 - .../java/com/adyen/service/management/WebhooksCompanyLevel.java | 1 - .../com/adyen/service/management/WebhooksMerchantLevel.java | 1 - src/test/java/com/adyen/CheckoutTest.java | 2 -- templates/libraries/okhttp-gson/JSON.mustache | 2 +- templates/libraries/okhttp-gson/api.mustache | 2 -- 56 files changed, 10 insertions(+), 75 deletions(-) diff --git a/src/main/java/com/adyen/model/balanceplatform/JSON.java b/src/main/java/com/adyen/model/balanceplatform/JSON.java index 508ebee39..3bd9506fa 100644 --- a/src/main/java/com/adyen/model/balanceplatform/JSON.java +++ b/src/main/java/com/adyen/model/balanceplatform/JSON.java @@ -85,7 +85,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - { + static { GsonBuilder gsonBuilder = createGson(); gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); diff --git a/src/main/java/com/adyen/model/binlookup/JSON.java b/src/main/java/com/adyen/model/binlookup/JSON.java index 4ab6e3b90..3e5c86c4d 100644 --- a/src/main/java/com/adyen/model/binlookup/JSON.java +++ b/src/main/java/com/adyen/model/binlookup/JSON.java @@ -85,7 +85,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - { + static { GsonBuilder gsonBuilder = createGson(); gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); diff --git a/src/main/java/com/adyen/model/checkout/JSON.java b/src/main/java/com/adyen/model/checkout/JSON.java index 3665fc1bb..e05f90fab 100644 --- a/src/main/java/com/adyen/model/checkout/JSON.java +++ b/src/main/java/com/adyen/model/checkout/JSON.java @@ -85,7 +85,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - { + static { GsonBuilder gsonBuilder = createGson(); gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); diff --git a/src/main/java/com/adyen/model/legalentitymanagement/JSON.java b/src/main/java/com/adyen/model/legalentitymanagement/JSON.java index d97f6661d..e3e73eb14 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/JSON.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/JSON.java @@ -85,7 +85,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - { + static { GsonBuilder gsonBuilder = createGson(); gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); diff --git a/src/main/java/com/adyen/model/management/JSON.java b/src/main/java/com/adyen/model/management/JSON.java index 8ae19af4b..1867abe98 100644 --- a/src/main/java/com/adyen/model/management/JSON.java +++ b/src/main/java/com/adyen/model/management/JSON.java @@ -85,7 +85,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - { + static { GsonBuilder gsonBuilder = createGson(); gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); diff --git a/src/main/java/com/adyen/model/payments/JSON.java b/src/main/java/com/adyen/model/payments/JSON.java index 990344717..f6ea3ea39 100644 --- a/src/main/java/com/adyen/model/payments/JSON.java +++ b/src/main/java/com/adyen/model/payments/JSON.java @@ -85,7 +85,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - { + static { GsonBuilder gsonBuilder = createGson(); gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); diff --git a/src/main/java/com/adyen/model/payout/JSON.java b/src/main/java/com/adyen/model/payout/JSON.java index 930000101..e4cea07b0 100644 --- a/src/main/java/com/adyen/model/payout/JSON.java +++ b/src/main/java/com/adyen/model/payout/JSON.java @@ -85,7 +85,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - { + static { GsonBuilder gsonBuilder = createGson(); gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); diff --git a/src/main/java/com/adyen/model/recurring/JSON.java b/src/main/java/com/adyen/model/recurring/JSON.java index c33f5c76e..ef7f3d491 100644 --- a/src/main/java/com/adyen/model/recurring/JSON.java +++ b/src/main/java/com/adyen/model/recurring/JSON.java @@ -85,7 +85,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - { + static { GsonBuilder gsonBuilder = createGson(); gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); diff --git a/src/main/java/com/adyen/model/transfers/JSON.java b/src/main/java/com/adyen/model/transfers/JSON.java index 9d5f218fa..29e12a9ef 100644 --- a/src/main/java/com/adyen/model/transfers/JSON.java +++ b/src/main/java/com/adyen/model/transfers/JSON.java @@ -85,7 +85,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri return clazz; } - { + static { GsonBuilder gsonBuilder = createGson(); gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); diff --git a/src/main/java/com/adyen/service/BinLookup.java b/src/main/java/com/adyen/service/BinLookup.java index 4bea031e5..876c719a6 100644 --- a/src/main/java/com/adyen/service/BinLookup.java +++ b/src/main/java/com/adyen/service/BinLookup.java @@ -2,7 +2,6 @@ import com.adyen.ApiKeyAuthenticatedService; import com.adyen.Client; -import com.adyen.model.binlookup.JSON; import com.adyen.model.binlookup.ThreeDSAvailabilityResponse; import com.adyen.model.binlookup.CostEstimateResponse; import com.adyen.model.binlookup.CostEstimateRequest; @@ -20,7 +19,6 @@ public BinLookup(Client client) { super(client); get3dsAvailability = new Get3dsAvailability(this); getCostEstimate = new GetCostEstimate(this); - new JSON(); } diff --git a/src/main/java/com/adyen/service/Checkout.java b/src/main/java/com/adyen/service/Checkout.java index a77d5878f..0e9e66e7c 100644 --- a/src/main/java/com/adyen/service/Checkout.java +++ b/src/main/java/com/adyen/service/Checkout.java @@ -26,7 +26,6 @@ import com.adyen.model.checkout.CreateStandalonePaymentCancelRequest; import com.adyen.model.checkout.DetailsRequest; import com.adyen.model.checkout.DonationResponse; -import com.adyen.model.checkout.JSON; import com.adyen.model.checkout.ListStoredPaymentMethodsResponse; import com.adyen.model.checkout.PaymentAmountUpdateResource; import com.adyen.model.checkout.PaymentCancelResource; @@ -96,7 +95,6 @@ public Checkout(Client client) { cardDetails = new CheckoutResource(this, "/cardDetails"); paymentLinks = new CheckoutResource(this, "/paymentLinks"); storedPaymentMethods = new CheckoutResource(this, "/storedPaymentMethods"); - new JSON(); } diff --git a/src/main/java/com/adyen/service/Payment.java b/src/main/java/com/adyen/service/Payment.java index 688fffe91..9e3b963a0 100644 --- a/src/main/java/com/adyen/service/Payment.java +++ b/src/main/java/com/adyen/service/Payment.java @@ -32,7 +32,6 @@ import com.adyen.model.payments.CaptureRequest; import com.adyen.model.payments.CommonField; import com.adyen.model.payments.DonationRequest; -import com.adyen.model.payments.JSON; import com.adyen.model.payments.ModificationResult; import com.adyen.model.payments.PaymentRequest; import com.adyen.model.payments.PaymentRequest3d; @@ -84,7 +83,6 @@ public Payment(Client client) { adjustAuthorisation = new PaymentResource(this, "/adjustAuthorisation"); donate = new PaymentResource(this, "/donate"); voidPendingRefund = new PaymentResource(this, "/voidPendingRefund"); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/Payout.java b/src/main/java/com/adyen/service/Payout.java index 957c37673..1ebdad8e9 100644 --- a/src/main/java/com/adyen/service/Payout.java +++ b/src/main/java/com/adyen/service/Payout.java @@ -23,7 +23,6 @@ import com.adyen.Client; import com.adyen.Service; import com.adyen.model.RequestOptions; -import com.adyen.model.payout.JSON; import com.adyen.model.payout.ModifyRequest; import com.adyen.model.payout.ModifyResponse; import com.adyen.model.payout.PayoutRequest; @@ -60,7 +59,6 @@ public Payout(Client client) { storeDetail = new StoreDetail(this); submitThirdparty = new SubmitThirdParty(this); payout = new com.adyen.service.resource.payout.Payout(this); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/Recurring.java b/src/main/java/com/adyen/service/Recurring.java index 83ae6693d..084b99ed4 100644 --- a/src/main/java/com/adyen/service/Recurring.java +++ b/src/main/java/com/adyen/service/Recurring.java @@ -24,7 +24,6 @@ import com.adyen.Service; import com.adyen.model.recurring.DisableRequest; import com.adyen.model.recurring.DisableResult; -import com.adyen.model.recurring.JSON; import com.adyen.model.recurring.NotifyShopperRequest; import com.adyen.model.recurring.NotifyShopperResult; import com.adyen.model.recurring.RecurringDetailsRequest; @@ -61,7 +60,6 @@ public Recurring(Client client) { notifyShopper = new NotifyShopper(this); createPermit = new CreatePermit(this); disablePermit = new DisablePermit(this); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/Transfers.java b/src/main/java/com/adyen/service/Transfers.java index 93a5347ca..a61dab9d6 100644 --- a/src/main/java/com/adyen/service/Transfers.java +++ b/src/main/java/com/adyen/service/Transfers.java @@ -3,7 +3,6 @@ import com.adyen.Client; import com.adyen.Service; import com.adyen.constants.ApiConstants; -import com.adyen.model.transfers.JSON; import com.adyen.model.transfers.TransactionSearchResponse; import com.adyen.model.transfers.Transfer; @@ -22,7 +21,6 @@ public class Transfers extends Service { public Transfers(Client client) { super(client); - new JSON(); } public Transfer transfers(TransferInfo transferInfo) throws IOException, ApiException { diff --git a/src/main/java/com/adyen/service/balanceplatform/AccountHolders.java b/src/main/java/com/adyen/service/balanceplatform/AccountHolders.java index 2457fcd2d..7722f78a8 100644 --- a/src/main/java/com/adyen/service/balanceplatform/AccountHolders.java +++ b/src/main/java/com/adyen/service/balanceplatform/AccountHolders.java @@ -5,7 +5,6 @@ import com.adyen.constants.ApiConstants; import com.adyen.model.balanceplatform.AccountHolder; import com.adyen.model.balanceplatform.AccountHolderInfo; -import com.adyen.model.balanceplatform.JSON; import com.adyen.model.balanceplatform.PaginatedBalanceAccountsResponse; import com.adyen.service.exception.ApiException; import com.adyen.service.resource.balanceplatform.BalancePlatformResource; @@ -18,7 +17,6 @@ public class AccountHolders extends Service { public AccountHolders(Client client) { super(client); - new JSON(); } public AccountHolder create(AccountHolderInfo request) throws IOException, ApiException { diff --git a/src/main/java/com/adyen/service/balanceplatform/BalanceAccounts.java b/src/main/java/com/adyen/service/balanceplatform/BalanceAccounts.java index 2691459f1..b852bc002 100644 --- a/src/main/java/com/adyen/service/balanceplatform/BalanceAccounts.java +++ b/src/main/java/com/adyen/service/balanceplatform/BalanceAccounts.java @@ -9,7 +9,6 @@ import com.adyen.model.balanceplatform.BalanceSweepConfigurationsResponse; import com.adyen.model.balanceplatform.SweepConfigurationV2; import com.adyen.model.balanceplatform.PaginatedPaymentInstrumentsResponse; -import com.adyen.model.balanceplatform.JSON; import com.adyen.service.exception.ApiException; import com.adyen.service.resource.balanceplatform.BalancePlatformResource; @@ -20,7 +19,6 @@ public class BalanceAccounts extends Service { public BalanceAccounts(Client client) { super(client); - new JSON(); } public BalanceAccount create(BalanceAccountInfo request) throws IOException, ApiException { diff --git a/src/main/java/com/adyen/service/balanceplatform/General.java b/src/main/java/com/adyen/service/balanceplatform/General.java index a99c79fbb..6de0840b8 100644 --- a/src/main/java/com/adyen/service/balanceplatform/General.java +++ b/src/main/java/com/adyen/service/balanceplatform/General.java @@ -4,7 +4,6 @@ import com.adyen.Service; import com.adyen.constants.ApiConstants; import com.adyen.model.balanceplatform.BalancePlatform; -import com.adyen.model.balanceplatform.JSON; import com.adyen.model.balanceplatform.PaginatedAccountHoldersResponse; import com.adyen.service.exception.ApiException; import com.adyen.service.resource.balanceplatform.BalancePlatformResource; @@ -16,7 +15,6 @@ public class General extends Service { public General(Client client) { super(client); - new JSON(); } public BalancePlatform retrieve(String platformId) throws IOException, ApiException { diff --git a/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroups.java b/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroups.java index 958677494..2872193cf 100644 --- a/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroups.java +++ b/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroups.java @@ -3,7 +3,6 @@ import com.adyen.Client; import com.adyen.Service; import com.adyen.constants.ApiConstants; -import com.adyen.model.balanceplatform.JSON; import com.adyen.model.balanceplatform.PaymentInstrumentGroup; import com.adyen.model.balanceplatform.PaymentInstrumentGroupInfo; import com.adyen.model.balanceplatform.TransactionRulesResponse; @@ -15,7 +14,6 @@ public class PaymentInstrumentGroups extends Service { public PaymentInstrumentGroups(Client client) { super(client); - new JSON(); } public PaymentInstrumentGroup create(PaymentInstrumentGroupInfo request) throws IOException, ApiException { diff --git a/src/main/java/com/adyen/service/balanceplatform/PaymentInstruments.java b/src/main/java/com/adyen/service/balanceplatform/PaymentInstruments.java index 23c94f63c..3715f8ebd 100644 --- a/src/main/java/com/adyen/service/balanceplatform/PaymentInstruments.java +++ b/src/main/java/com/adyen/service/balanceplatform/PaymentInstruments.java @@ -6,7 +6,6 @@ import com.adyen.model.balanceplatform.PaymentInstrument; import com.adyen.model.balanceplatform.PaymentInstrumentInfo; import com.adyen.model.balanceplatform.PaymentInstrumentUpdateRequest; -import com.adyen.model.balanceplatform.JSON; import com.adyen.model.balanceplatform.TransactionRulesResponse; import com.adyen.service.exception.ApiException; import com.adyen.service.resource.balanceplatform.BalancePlatformResource; @@ -16,7 +15,6 @@ public class PaymentInstruments extends Service { public PaymentInstruments(Client client) { super(client); - new JSON(); } public PaymentInstrument create(PaymentInstrumentInfo request) throws IOException, ApiException { diff --git a/src/main/java/com/adyen/service/balanceplatform/TransactionRules.java b/src/main/java/com/adyen/service/balanceplatform/TransactionRules.java index 2054c3c66..c7ce9ad09 100644 --- a/src/main/java/com/adyen/service/balanceplatform/TransactionRules.java +++ b/src/main/java/com/adyen/service/balanceplatform/TransactionRules.java @@ -3,7 +3,6 @@ import com.adyen.Client; import com.adyen.Service; import com.adyen.constants.ApiConstants; -import com.adyen.model.balanceplatform.JSON; import com.adyen.model.balanceplatform.TransactionRule; import com.adyen.model.balanceplatform.TransactionRuleInfo; import com.adyen.model.balanceplatform.TransactionRuleResponse; @@ -16,7 +15,6 @@ public class TransactionRules extends Service { public TransactionRules(Client client) { super(client); - new JSON(); } public TransactionRule create(TransactionRuleInfo request) throws IOException, ApiException { diff --git a/src/main/java/com/adyen/service/legalentitymanagement/BusinessLineService.java b/src/main/java/com/adyen/service/legalentitymanagement/BusinessLineService.java index c156a21c1..eda063234 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/BusinessLineService.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/BusinessLineService.java @@ -5,7 +5,6 @@ import com.adyen.constants.ApiConstants; import com.adyen.model.legalentitymanagement.BusinessLine; import com.adyen.model.legalentitymanagement.BusinessLineInfo; -import com.adyen.model.management.JSON; import com.adyen.service.exception.ApiException; import com.adyen.service.resource.LegalEntityManagementResource; @@ -14,7 +13,6 @@ public class BusinessLineService extends Service { public BusinessLineService(Client client) { super(client); - new JSON(); } public BusinessLine create(BusinessLineInfo request) throws IOException, ApiException { diff --git a/src/main/java/com/adyen/service/legalentitymanagement/Documents.java b/src/main/java/com/adyen/service/legalentitymanagement/Documents.java index d71667fc4..db992f65f 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/Documents.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/Documents.java @@ -4,7 +4,6 @@ import com.adyen.Service; import com.adyen.constants.ApiConstants; import com.adyen.model.legalentitymanagement.Document; -import com.adyen.model.legalentitymanagement.JSON; import com.adyen.service.exception.ApiException; import com.adyen.service.resource.LegalEntityManagementResource; @@ -13,7 +12,6 @@ public class Documents extends Service { public Documents(Client client) { super(client); - new JSON(); } public Document create(Document request) throws IOException, ApiException { diff --git a/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboarding.java b/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboarding.java index f7b79686e..10e2c9987 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboarding.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboarding.java @@ -7,7 +7,6 @@ import com.adyen.model.legalentitymanagement.OnboardingLinkInfo; import com.adyen.model.legalentitymanagement.OnboardingTheme; import com.adyen.model.legalentitymanagement.OnboardingThemes; -import com.adyen.model.legalentitymanagement.JSON; import com.adyen.service.exception.ApiException; import com.adyen.service.resource.LegalEntityManagementResource; @@ -16,7 +15,6 @@ public class HostedOnboarding extends Service { public HostedOnboarding(Client client) { super(client); - new JSON(); } public OnboardingLink create(String legalEntityId, OnboardingLinkInfo request) throws IOException, ApiException { diff --git a/src/main/java/com/adyen/service/legalentitymanagement/LegalEntities.java b/src/main/java/com/adyen/service/legalentitymanagement/LegalEntities.java index 91efacba8..068c508a0 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/LegalEntities.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/LegalEntities.java @@ -6,7 +6,6 @@ import com.adyen.model.legalentitymanagement.BusinessLines; import com.adyen.model.legalentitymanagement.LegalEntity; import com.adyen.model.legalentitymanagement.LegalEntityInfo; -import com.adyen.model.legalentitymanagement.JSON; import com.adyen.service.exception.ApiException; import com.adyen.service.resource.LegalEntityManagementResource; @@ -15,7 +14,6 @@ public class LegalEntities extends Service { public LegalEntities(Client client) { super(client); - new JSON(); } public LegalEntity create(LegalEntityInfo request) throws IOException, ApiException { diff --git a/src/main/java/com/adyen/service/legalentitymanagement/TransferInstruments.java b/src/main/java/com/adyen/service/legalentitymanagement/TransferInstruments.java index d5fa0be48..ec41c0d11 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/TransferInstruments.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/TransferInstruments.java @@ -5,7 +5,6 @@ import com.adyen.constants.ApiConstants; import com.adyen.model.legalentitymanagement.TransferInstrument; import com.adyen.model.legalentitymanagement.TransferInstrumentInfo; -import com.adyen.model.legalentitymanagement.JSON; import com.adyen.service.exception.ApiException; import com.adyen.service.resource.LegalEntityManagementResource; @@ -14,7 +13,6 @@ public class TransferInstruments extends Service { public TransferInstruments(Client client) { super(client); - new JSON(); } public TransferInstrument create(TransferInstrumentInfo request) throws IOException, ApiException { diff --git a/src/main/java/com/adyen/service/management/AccountCompanyLevel.java b/src/main/java/com/adyen/service/management/AccountCompanyLevel.java index 9605a0752..6d2f4cc78 100644 --- a/src/main/java/com/adyen/service/management/AccountCompanyLevel.java +++ b/src/main/java/com/adyen/service/management/AccountCompanyLevel.java @@ -30,7 +30,6 @@ public class AccountCompanyLevel extends ApiKeyAuthenticatedService { public AccountCompanyLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/AccountMerchantLevel.java b/src/main/java/com/adyen/service/management/AccountMerchantLevel.java index 648b6d53e..bf7c41c28 100644 --- a/src/main/java/com/adyen/service/management/AccountMerchantLevel.java +++ b/src/main/java/com/adyen/service/management/AccountMerchantLevel.java @@ -32,7 +32,6 @@ public class AccountMerchantLevel extends ApiKeyAuthenticatedService { public AccountMerchantLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/AccountStoreLevel.java b/src/main/java/com/adyen/service/management/AccountStoreLevel.java index e96836489..2eb187cc8 100644 --- a/src/main/java/com/adyen/service/management/AccountStoreLevel.java +++ b/src/main/java/com/adyen/service/management/AccountStoreLevel.java @@ -32,7 +32,6 @@ public class AccountStoreLevel extends ApiKeyAuthenticatedService { public AccountStoreLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevel.java b/src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevel.java index 2cad1e5ea..7fbb6a110 100644 --- a/src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevel.java +++ b/src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevel.java @@ -29,7 +29,6 @@ public class AllowedOriginsCompanyLevel extends ApiKeyAuthenticatedService { public AllowedOriginsCompanyLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevel.java b/src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevel.java index d662ad795..56c8638b2 100644 --- a/src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevel.java +++ b/src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevel.java @@ -29,7 +29,6 @@ public class AllowedOriginsMerchantLevel extends ApiKeyAuthenticatedService { public AllowedOriginsMerchantLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevel.java b/src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevel.java index 5a20f64e6..f377da575 100644 --- a/src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevel.java +++ b/src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevel.java @@ -32,7 +32,6 @@ public class ApiCredentialsCompanyLevel extends ApiKeyAuthenticatedService { public ApiCredentialsCompanyLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevel.java b/src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevel.java index a3cb6402a..d1f69926a 100644 --- a/src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevel.java +++ b/src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevel.java @@ -32,7 +32,6 @@ public class ApiCredentialsMerchantLevel extends ApiKeyAuthenticatedService { public ApiCredentialsMerchantLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/ApiKeyCompanyLevel.java b/src/main/java/com/adyen/service/management/ApiKeyCompanyLevel.java index 58853ceb9..f37c5198f 100644 --- a/src/main/java/com/adyen/service/management/ApiKeyCompanyLevel.java +++ b/src/main/java/com/adyen/service/management/ApiKeyCompanyLevel.java @@ -28,7 +28,6 @@ public class ApiKeyCompanyLevel extends ApiKeyAuthenticatedService { public ApiKeyCompanyLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/ApiKeyMerchantLevel.java b/src/main/java/com/adyen/service/management/ApiKeyMerchantLevel.java index e6b84e45b..f4986a1ab 100644 --- a/src/main/java/com/adyen/service/management/ApiKeyMerchantLevel.java +++ b/src/main/java/com/adyen/service/management/ApiKeyMerchantLevel.java @@ -28,7 +28,6 @@ public class ApiKeyMerchantLevel extends ApiKeyAuthenticatedService { public ApiKeyMerchantLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/ClientKeyCompanyLevel.java b/src/main/java/com/adyen/service/management/ClientKeyCompanyLevel.java index c2958185b..bed01776b 100644 --- a/src/main/java/com/adyen/service/management/ClientKeyCompanyLevel.java +++ b/src/main/java/com/adyen/service/management/ClientKeyCompanyLevel.java @@ -28,7 +28,6 @@ public class ClientKeyCompanyLevel extends ApiKeyAuthenticatedService { public ClientKeyCompanyLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/ClientKeyMerchantLevel.java b/src/main/java/com/adyen/service/management/ClientKeyMerchantLevel.java index 427b5092c..44ff86681 100644 --- a/src/main/java/com/adyen/service/management/ClientKeyMerchantLevel.java +++ b/src/main/java/com/adyen/service/management/ClientKeyMerchantLevel.java @@ -28,7 +28,6 @@ public class ClientKeyMerchantLevel extends ApiKeyAuthenticatedService { public ClientKeyMerchantLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/MyApiCredential.java b/src/main/java/com/adyen/service/management/MyApiCredential.java index b2e50db30..133bd7dcf 100644 --- a/src/main/java/com/adyen/service/management/MyApiCredential.java +++ b/src/main/java/com/adyen/service/management/MyApiCredential.java @@ -31,7 +31,6 @@ public class MyApiCredential extends ApiKeyAuthenticatedService { public MyApiCredential(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevel.java b/src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevel.java index f6621e1c5..9a5fae238 100644 --- a/src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevel.java +++ b/src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevel.java @@ -32,7 +32,6 @@ public class PaymentMethodsMerchantLevel extends ApiKeyAuthenticatedService { public PaymentMethodsMerchantLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevel.java b/src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevel.java index 1f277283d..dbd3d436b 100644 --- a/src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevel.java +++ b/src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevel.java @@ -31,7 +31,6 @@ public class PayoutSettingsMerchantLevel extends ApiKeyAuthenticatedService { public PayoutSettingsMerchantLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/TerminalActionsCompanyLevel.java b/src/main/java/com/adyen/service/management/TerminalActionsCompanyLevel.java index cdddb1a77..d80904af7 100644 --- a/src/main/java/com/adyen/service/management/TerminalActionsCompanyLevel.java +++ b/src/main/java/com/adyen/service/management/TerminalActionsCompanyLevel.java @@ -31,7 +31,6 @@ public class TerminalActionsCompanyLevel extends ApiKeyAuthenticatedService { public TerminalActionsCompanyLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/TerminalActionsTerminalLevel.java b/src/main/java/com/adyen/service/management/TerminalActionsTerminalLevel.java index 27accaa25..b61328909 100644 --- a/src/main/java/com/adyen/service/management/TerminalActionsTerminalLevel.java +++ b/src/main/java/com/adyen/service/management/TerminalActionsTerminalLevel.java @@ -29,7 +29,6 @@ public class TerminalActionsTerminalLevel extends ApiKeyAuthenticatedService { public TerminalActionsTerminalLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevel.java b/src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevel.java index ff65bcf8e..4336f7939 100644 --- a/src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevel.java +++ b/src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevel.java @@ -35,7 +35,6 @@ public class TerminalOrdersCompanyLevel extends ApiKeyAuthenticatedService { public TerminalOrdersCompanyLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevel.java b/src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevel.java index 111b7b86d..49f74bd6f 100644 --- a/src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevel.java +++ b/src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevel.java @@ -35,7 +35,6 @@ public class TerminalOrdersMerchantLevel extends ApiKeyAuthenticatedService { public TerminalOrdersMerchantLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevel.java b/src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevel.java index ba0551467..1f342d956 100644 --- a/src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevel.java +++ b/src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevel.java @@ -29,7 +29,6 @@ public class TerminalSettingsCompanyLevel extends ApiKeyAuthenticatedService { public TerminalSettingsCompanyLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevel.java b/src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevel.java index 5b772b00f..d358529f1 100644 --- a/src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevel.java +++ b/src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevel.java @@ -29,7 +29,6 @@ public class TerminalSettingsMerchantLevel extends ApiKeyAuthenticatedService { public TerminalSettingsMerchantLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsStoreLevel.java b/src/main/java/com/adyen/service/management/TerminalSettingsStoreLevel.java index 7fe014262..02ffdfab7 100644 --- a/src/main/java/com/adyen/service/management/TerminalSettingsStoreLevel.java +++ b/src/main/java/com/adyen/service/management/TerminalSettingsStoreLevel.java @@ -29,7 +29,6 @@ public class TerminalSettingsStoreLevel extends ApiKeyAuthenticatedService { public TerminalSettingsStoreLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevel.java b/src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevel.java index 6294fae5d..2b5164b81 100644 --- a/src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevel.java +++ b/src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevel.java @@ -29,7 +29,6 @@ public class TerminalSettingsTerminalLevel extends ApiKeyAuthenticatedService { public TerminalSettingsTerminalLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/TerminalsTerminalLevel.java b/src/main/java/com/adyen/service/management/TerminalsTerminalLevel.java index 85dd34c92..7afd2e247 100644 --- a/src/main/java/com/adyen/service/management/TerminalsTerminalLevel.java +++ b/src/main/java/com/adyen/service/management/TerminalsTerminalLevel.java @@ -28,7 +28,6 @@ public class TerminalsTerminalLevel extends ApiKeyAuthenticatedService { public TerminalsTerminalLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/UsersCompanyLevel.java b/src/main/java/com/adyen/service/management/UsersCompanyLevel.java index eb05eed1a..9efd57c60 100644 --- a/src/main/java/com/adyen/service/management/UsersCompanyLevel.java +++ b/src/main/java/com/adyen/service/management/UsersCompanyLevel.java @@ -32,7 +32,6 @@ public class UsersCompanyLevel extends ApiKeyAuthenticatedService { public UsersCompanyLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/UsersMerchantLevel.java b/src/main/java/com/adyen/service/management/UsersMerchantLevel.java index d52ff1513..104a0bb2e 100644 --- a/src/main/java/com/adyen/service/management/UsersMerchantLevel.java +++ b/src/main/java/com/adyen/service/management/UsersMerchantLevel.java @@ -32,7 +32,6 @@ public class UsersMerchantLevel extends ApiKeyAuthenticatedService { public UsersMerchantLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/WebhooksCompanyLevel.java b/src/main/java/com/adyen/service/management/WebhooksCompanyLevel.java index fd2117fcc..77c02136a 100644 --- a/src/main/java/com/adyen/service/management/WebhooksCompanyLevel.java +++ b/src/main/java/com/adyen/service/management/WebhooksCompanyLevel.java @@ -34,7 +34,6 @@ public class WebhooksCompanyLevel extends ApiKeyAuthenticatedService { public WebhooksCompanyLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/main/java/com/adyen/service/management/WebhooksMerchantLevel.java b/src/main/java/com/adyen/service/management/WebhooksMerchantLevel.java index 7611c808e..a98cb34c1 100644 --- a/src/main/java/com/adyen/service/management/WebhooksMerchantLevel.java +++ b/src/main/java/com/adyen/service/management/WebhooksMerchantLevel.java @@ -34,7 +34,6 @@ public class WebhooksMerchantLevel extends ApiKeyAuthenticatedService { public WebhooksMerchantLevel(Client client) { super(client); - new JSON(); } /** diff --git a/src/test/java/com/adyen/CheckoutTest.java b/src/test/java/com/adyen/CheckoutTest.java index b2c97cf22..a8abd0fd6 100644 --- a/src/test/java/com/adyen/CheckoutTest.java +++ b/src/test/java/com/adyen/CheckoutTest.java @@ -116,7 +116,6 @@ public void TestPaymentDefaultApplicationInfo() throws Exception { */ @Test public void TestPaymentRequestSerialization() throws Exception { - new JSON(); String paymentRequestJson = getFileContents("mocks/checkout/paymentRequest.json"); IdealDetails idealDetails = new IdealDetails(); idealDetails.setIssuer("issuerName"); @@ -370,7 +369,6 @@ public void TestCardDetailsRequestSuccess() throws Exception { */ @Test public void TestDateSerialization() throws Exception { - new JSON(); CheckoutBalanceCheckRequest checkoutBalanceCheckRequest = new CheckoutBalanceCheckRequest(); OffsetDateTime date = OffsetDateTime.parse("2022-10-11T15:08:27.000Z"); // Tuesday, October 11, 2022 5:08:27 PM GMT+02:00 DST checkoutBalanceCheckRequest.setDateOfBirth(date.toLocalDate()); diff --git a/templates/libraries/okhttp-gson/JSON.mustache b/templates/libraries/okhttp-gson/JSON.mustache index 3bd1a8155..f6d35d7d0 100644 --- a/templates/libraries/okhttp-gson/JSON.mustache +++ b/templates/libraries/okhttp-gson/JSON.mustache @@ -109,7 +109,7 @@ public class JSON { return clazz; } - { + static { GsonBuilder gsonBuilder = createGson(); gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); diff --git a/templates/libraries/okhttp-gson/api.mustache b/templates/libraries/okhttp-gson/api.mustache index 60b6fb994..fe99720ce 100644 --- a/templates/libraries/okhttp-gson/api.mustache +++ b/templates/libraries/okhttp-gson/api.mustache @@ -5,7 +5,6 @@ package {{package}}; import com.adyen.ApiKeyAuthenticatedService; import com.adyen.Client; import com.adyen.constants.ApiConstants; -import {{modelPackage}}.JSON; {{#imports}}import {{import}}; {{/imports}} import com.adyen.service.exception.ApiException; @@ -19,7 +18,6 @@ import java.util.Map; public class {{classname}} extends ApiKeyAuthenticatedService { public {{classname}}(Client client) { super(client); - new JSON(); } {{#operation}} From 4ef42250a0ba35786f80f003284bbd5f52c0c1a6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 10:18:23 +0200 Subject: [PATCH 06/32] Update dependency org.mockito:mockito-core to v5.3.0 (#949) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index edd4dfb92..8744b57cd 100644 --- a/pom.xml +++ b/pom.xml @@ -207,7 +207,7 @@ org.mockito mockito-core - 5.0.0 + 5.3.0 test From 66c2522b4e410ab43a199d86b3e0ec34c4dccc1e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 10:18:44 +0200 Subject: [PATCH 07/32] Update peter-evans/create-pull-request action to v5 (#995) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/models.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/models.yml b/.github/workflows/models.yml index 1fd6e37e4..179560008 100644 --- a/.github/workflows/models.yml +++ b/.github/workflows/models.yml @@ -17,7 +17,7 @@ jobs: echo ::set-output name=pr_body::"OpenAPI spec or templates produced new models on $(date +%d-%m-%Y) \ by [commit](https://github.com/Adyen/adyen-openapi/commit/$(git rev-parse HEAD))." - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 + uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }} committer: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }} From 3e5f8754286a73d2703374543625549d931e4bc6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 10:19:30 +0200 Subject: [PATCH 08/32] Update dependency io.swagger:swagger-annotations to v1.6.10 (#985) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8744b57cd..c138bdccc 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ UTF-8 UTF-8 - 1.6.9 + 1.6.10 scm:git:git@github.com:Adyen/adyen-java-api-library.git From 6251161ccb60265897c31078b43f61db6d1d4d3b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 10:19:41 +0200 Subject: [PATCH 09/32] Update dependency io.swagger.core.v3:swagger-annotations to v2.2.9 (#983) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c138bdccc..12f1f035d 100644 --- a/pom.xml +++ b/pom.xml @@ -219,7 +219,7 @@ io.swagger.core.v3 swagger-annotations - 2.2.8 + 2.2.9 compile From 6239fa6985ffc01046a1fbf6c2091ff679450b0a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 10:20:02 +0200 Subject: [PATCH 10/32] Update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.11.0 (#970) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 12f1f035d..b908c7978 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.11.0 1.8 1.8 From e23a9ba425c4ae4484165fb6d4bee2d70db65a7e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 10:27:11 +0200 Subject: [PATCH 11/32] Update dependency org.jacoco:jacoco-maven-plugin to v0.8.9 (#994) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b908c7978..70bf7e3b5 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ org.jacoco jacoco-maven-plugin - 0.8.8 + 0.8.9 default-prepare-agent From 9fc2f5f8bac3d689bca8bb6970bd61595c3b96b5 Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot <38424300+AdyenAutomationBot@users.noreply.github.com> Date: Thu, 13 Apr 2023 12:58:28 +0200 Subject: [PATCH 12/32] Update models (#998) * [create-pull-request] automated change * fix recurring test (to match actual api response) --------- Co-authored-by: jillingk <93914435+jillingk@users.noreply.github.com> --- .../java/com/adyen/model/recurring/Card.java | 13 +- .../java/com/adyen/model/recurring/JSON.java | 1 + .../recurring/RecurringDetailWrapper.java | 209 ++++++++++++++++++ .../recurring/RecurringDetailsResult.java | 14 +- .../com/adyen/model/transfers/Transfer.java | 4 +- .../adyen/model/transfers/TransferInfo.java | 4 +- src/test/java/com/adyen/RecurringTest.java | 2 +- .../listRecurringDetails-success.json | 7 +- 8 files changed, 228 insertions(+), 26 deletions(-) create mode 100644 src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java diff --git a/src/main/java/com/adyen/model/recurring/Card.java b/src/main/java/com/adyen/model/recurring/Card.java index 60f8bc292..15b469913 100644 --- a/src/main/java/com/adyen/model/recurring/Card.java +++ b/src/main/java/com/adyen/model/recurring/Card.java @@ -137,7 +137,7 @@ public Card expiryYear(String expiryYear) { * The card expiry year. Format: 4 digits. For example: 2020 * @return expiryYear **/ - @ApiModelProperty(required = true, value = "The card expiry year. Format: 4 digits. For example: 2020") + @ApiModelProperty(value = "The card expiry year. Format: 4 digits. For example: 2020") public String getExpiryYear() { return expiryYear; @@ -159,7 +159,7 @@ public Card holderName(String holderName) { * The name of the cardholder, as printed on the card. * @return holderName **/ - @ApiModelProperty(required = true, value = "The name of the cardholder, as printed on the card.") + @ApiModelProperty(value = "The name of the cardholder, as printed on the card.") public String getHolderName() { return holderName; @@ -329,8 +329,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("expiryYear"); - openapiRequiredFields.add("holderName"); } /** @@ -355,13 +353,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Card` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Card.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } // validate the optional field cvc if (jsonObj.get("cvc") != null && !jsonObj.get("cvc").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `cvc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvc").toString())); diff --git a/src/main/java/com/adyen/model/recurring/JSON.java b/src/main/java/com/adyen/model/recurring/JSON.java index ef7f3d491..980639353 100644 --- a/src/main/java/com/adyen/model/recurring/JSON.java +++ b/src/main/java/com/adyen/model/recurring/JSON.java @@ -110,6 +110,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.recurring.PermitResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.recurring.Recurring.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.recurring.RecurringDetail.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.recurring.RecurringDetailWrapper.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.recurring.RecurringDetailsRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.recurring.RecurringDetailsResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.recurring.ScheduleAccountUpdaterRequest.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java b/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java new file mode 100644 index 000000000..032f47611 --- /dev/null +++ b/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java @@ -0,0 +1,209 @@ +/* + * Adyen Recurring API + * + * The version of the OpenAPI document: 68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.recurring; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.recurring.RecurringDetail; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.recurring.JSON; + +/** + * RecurringDetailWrapper + */ + +public class RecurringDetailWrapper { + public static final String SERIALIZED_NAME_RECURRING_DETAIL = "RecurringDetail"; + @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL) + private RecurringDetail recurringDetail; + + public RecurringDetailWrapper() { + } + + public RecurringDetailWrapper recurringDetail(RecurringDetail recurringDetail) { + + this.recurringDetail = recurringDetail; + return this; + } + + /** + * Get recurringDetail + * @return recurringDetail + **/ + @ApiModelProperty(value = "") + + public RecurringDetail getRecurringDetail() { + return recurringDetail; + } + + + public void setRecurringDetail(RecurringDetail recurringDetail) { + this.recurringDetail = recurringDetail; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RecurringDetailWrapper recurringDetailWrapper = (RecurringDetailWrapper) o; + return Objects.equals(this.recurringDetail, recurringDetailWrapper.recurringDetail); + } + + @Override + public int hashCode() { + return Objects.hash(recurringDetail); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RecurringDetailWrapper {\n"); + sb.append(" recurringDetail: ").append(toIndentedString(recurringDetail)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("RecurringDetail"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RecurringDetailWrapper + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (RecurringDetailWrapper.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in RecurringDetailWrapper is not found in the empty JSON string", RecurringDetailWrapper.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RecurringDetailWrapper.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RecurringDetailWrapper` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `RecurringDetail` + if (jsonObj.getAsJsonObject("RecurringDetail") != null) { + RecurringDetail.validateJsonObject(jsonObj.getAsJsonObject("RecurringDetail")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RecurringDetailWrapper.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RecurringDetailWrapper' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RecurringDetailWrapper.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RecurringDetailWrapper value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RecurringDetailWrapper read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RecurringDetailWrapper given an JSON string + * + * @param jsonString JSON string + * @return An instance of RecurringDetailWrapper + * @throws IOException if the JSON string is invalid with respect to RecurringDetailWrapper + */ + public static RecurringDetailWrapper fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RecurringDetailWrapper.class); + } + + /** + * Convert an instance of RecurringDetailWrapper to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java b/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java index 8c80eabd4..f0188d938 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java @@ -14,7 +14,7 @@ import java.util.Objects; import java.util.Arrays; -import com.adyen.model.recurring.RecurringDetail; +import com.adyen.model.recurring.RecurringDetailWrapper; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -58,7 +58,7 @@ public class RecurringDetailsResult { public static final String SERIALIZED_NAME_DETAILS = "details"; @SerializedName(SERIALIZED_NAME_DETAILS) - private List details = null; + private List details = null; public static final String SERIALIZED_NAME_LAST_KNOWN_SHOPPER_EMAIL = "lastKnownShopperEmail"; @SerializedName(SERIALIZED_NAME_LAST_KNOWN_SHOPPER_EMAIL) @@ -93,13 +93,13 @@ public void setCreationDate(OffsetDateTime creationDate) { } - public RecurringDetailsResult details(List details) { + public RecurringDetailsResult details(List details) { this.details = details; return this; } - public RecurringDetailsResult addDetailsItem(RecurringDetail detailsItem) { + public RecurringDetailsResult addDetailsItem(RecurringDetailWrapper detailsItem) { if (this.details == null) { this.details = new ArrayList<>(); } @@ -113,12 +113,12 @@ public RecurringDetailsResult addDetailsItem(RecurringDetail detailsItem) { **/ @ApiModelProperty(value = "Payment details stored for recurring payments.") - public List getDetails() { + public List getDetails() { return details; } - public void setDetails(List details) { + public void setDetails(List details) { this.details = details; } @@ -258,7 +258,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `details` (array) for (int i = 0; i < jsonArraydetails.size(); i++) { - RecurringDetail.validateJsonObject(jsonArraydetails.get(i).getAsJsonObject()); + RecurringDetailWrapper.validateJsonObject(jsonArraydetails.get(i).getAsJsonObject()); }; } // validate the optional field lastKnownShopperEmail diff --git a/src/main/java/com/adyen/model/transfers/Transfer.java b/src/main/java/com/adyen/model/transfers/Transfer.java index a0db052b6..6d7cc3998 100644 --- a/src/main/java/com/adyen/model/transfers/Transfer.java +++ b/src/main/java/com/adyen/model/transfers/Transfer.java @@ -589,10 +589,10 @@ public Transfer description(String description) { } /** - * A human-readable description for the transfer. You can use alphanumeric characters and hyphens. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. + * Your description for the transfer. It is used by most banks as the transfer description. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. Supported characters: **[a-z] [A-Z] [0-9] / - ?** **: ( ) . , ' + Space** Supported characters for **regular** and **fast** transfers to a US counterparty: **[a-z] [A-Z] [0-9] & $ % # @** **~ = + - _ ' \" ! ?** * @return description **/ - @ApiModelProperty(value = "A human-readable description for the transfer. You can use alphanumeric characters and hyphens. We recommend sending a maximum of 140 characters, otherwise the description may be truncated.") + @ApiModelProperty(value = "Your description for the transfer. It is used by most banks as the transfer description. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. Supported characters: **[a-z] [A-Z] [0-9] / - ?** **: ( ) . , ' + Space** Supported characters for **regular** and **fast** transfers to a US counterparty: **[a-z] [A-Z] [0-9] & $ % # @** **~ = + - _ ' \" ! ?**") public String getDescription() { return description; diff --git a/src/main/java/com/adyen/model/transfers/TransferInfo.java b/src/main/java/com/adyen/model/transfers/TransferInfo.java index fa067cbcb..2ee2667d9 100644 --- a/src/main/java/com/adyen/model/transfers/TransferInfo.java +++ b/src/main/java/com/adyen/model/transfers/TransferInfo.java @@ -296,10 +296,10 @@ public TransferInfo description(String description) { } /** - * A human-readable description for the transfer. You can use alphanumeric characters and hyphens. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. + * Your description for the transfer. It is used by most banks as the transfer description. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. Supported characters: **[a-z] [A-Z] [0-9] / - ?** **: ( ) . , ' + Space** Supported characters for **regular** and **fast** transfers to a US counterparty: **[a-z] [A-Z] [0-9] & $ % # @** **~ = + - _ ' \" ! ?** * @return description **/ - @ApiModelProperty(value = "A human-readable description for the transfer. You can use alphanumeric characters and hyphens. We recommend sending a maximum of 140 characters, otherwise the description may be truncated.") + @ApiModelProperty(value = "Your description for the transfer. It is used by most banks as the transfer description. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. Supported characters: **[a-z] [A-Z] [0-9] / - ?** **: ( ) . , ' + Space** Supported characters for **regular** and **fast** transfers to a US counterparty: **[a-z] [A-Z] [0-9] & $ % # @** **~ = + - _ ' \" ! ?**") public String getDescription() { return description; diff --git a/src/test/java/com/adyen/RecurringTest.java b/src/test/java/com/adyen/RecurringTest.java index 39c6c283b..6e664e290 100644 --- a/src/test/java/com/adyen/RecurringTest.java +++ b/src/test/java/com/adyen/RecurringTest.java @@ -85,7 +85,7 @@ public void testListRecurringDetails() throws Exception { RecurringDetailsResult result = recurring.listRecurringDetails(request); assertEquals(2, result.getDetails().size()); - RecurringDetail recurringDetail = result.getDetails().get(0); + RecurringDetail recurringDetail = result.getDetails().get(0).getRecurringDetail(); assertEquals("recurringReference", recurringDetail.getRecurringDetailReference()); assertEquals("cardAlias", recurringDetail.getAlias()); assertEquals("1111", recurringDetail.getCard().getNumber()); diff --git a/src/test/resources/mocks/recurring/listRecurringDetails-success.json b/src/test/resources/mocks/recurring/listRecurringDetails-success.json index 1571873b4..181445cbe 100644 --- a/src/test/resources/mocks/recurring/listRecurringDetails-success.json +++ b/src/test/resources/mocks/recurring/listRecurringDetails-success.json @@ -1,7 +1,7 @@ { "creationDate": "2017-03-01T11:53:11+01:00", "details": [ - { + {"RecurringDetail": { "additionalData": { "cardBin": "411111" }, @@ -21,8 +21,8 @@ "paymentMethodVariant": "visa", "recurringDetailReference": "recurringReference", "variant": "visa" - }, - { + }}, + {"RecurringDetail": { "billingAddress": { "city": "City", "country": "NL", @@ -48,6 +48,7 @@ }, "variant": "paypal" } + } ], "shopperReference": "test-123" } From f6dd7cf40aa4a1815aaf2880caf5f0e6b2d0aca4 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Fri, 14 Apr 2023 14:24:08 +0200 Subject: [PATCH 13/32] Fix issue for wrong return type creatSweep and add missing endpoint in BCL v2 (#989) --- .../balanceplatform/BalanceAccounts.java | 4 ++-- .../BankAccountValidation.java | 24 +++++++++++++++++++ .../java/com/adyen/BalancePlatformTest.java | 19 +++++++++++---- 3 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/adyen/service/balanceplatform/BankAccountValidation.java diff --git a/src/main/java/com/adyen/service/balanceplatform/BalanceAccounts.java b/src/main/java/com/adyen/service/balanceplatform/BalanceAccounts.java index b852bc002..2c2358bc5 100644 --- a/src/main/java/com/adyen/service/balanceplatform/BalanceAccounts.java +++ b/src/main/java/com/adyen/service/balanceplatform/BalanceAccounts.java @@ -34,11 +34,11 @@ public BalanceSweepConfigurationsResponse listSweeps(String balanceAccountId, Ma return BalanceSweepConfigurationsResponse.fromJson(jsonResult); } - public BalanceSweepConfigurationsResponse createSweep(String balanceAccountId, SweepConfigurationV2 request) throws IOException, ApiException { + public SweepConfigurationV2 createSweep(String balanceAccountId, SweepConfigurationV2 request) throws IOException, ApiException { String jsonRequest = request.toJson(); BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/balanceAccounts/%s/sweeps", balanceAccountId)); String jsonResult = resource.request(jsonRequest, ApiConstants.HttpMethod.POST); - return BalanceSweepConfigurationsResponse.fromJson(jsonResult); + return SweepConfigurationV2.fromJson(jsonResult); } public void deleteSweep(String balanceAccountId, String sweepId) throws IOException, ApiException { diff --git a/src/main/java/com/adyen/service/balanceplatform/BankAccountValidation.java b/src/main/java/com/adyen/service/balanceplatform/BankAccountValidation.java new file mode 100644 index 000000000..80a7f0814 --- /dev/null +++ b/src/main/java/com/adyen/service/balanceplatform/BankAccountValidation.java @@ -0,0 +1,24 @@ +package com.adyen.service.balanceplatform; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.model.balanceplatform.JSON; +import com.adyen.model.balanceplatform.BankAccountIdentificationValidationRequest; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.balanceplatform.BalancePlatformResource; + +import java.io.IOException; + +public class BankAccountValidation extends Service { + + public BankAccountValidation(Client client) { + super(client); + new JSON(); + } + + public void validateBankAccountIdentification(BankAccountIdentificationValidationRequest bankAccountIdentificationValidationRequest) throws IOException, ApiException { + String jsonRequest = bankAccountIdentificationValidationRequest.toJson(); + BalancePlatformResource resource = new BalancePlatformResource(this, "/validateBankAccountIdentification"); + resource.request(jsonRequest); + } +} diff --git a/src/test/java/com/adyen/BalancePlatformTest.java b/src/test/java/com/adyen/BalancePlatformTest.java index 84de6ebb9..6cf56e6f6 100644 --- a/src/test/java/com/adyen/BalancePlatformTest.java +++ b/src/test/java/com/adyen/BalancePlatformTest.java @@ -8,6 +8,7 @@ import com.adyen.model.balanceplatform.BalanceAccountUpdateRequest; import com.adyen.model.balanceplatform.BalancePlatform; import com.adyen.model.balanceplatform.BalanceSweepConfigurationsResponse; +import com.adyen.model.balanceplatform.BankAccountIdentificationValidationRequest; import com.adyen.model.balanceplatform.PaginatedAccountHoldersResponse; import com.adyen.model.balanceplatform.PaginatedBalanceAccountsResponse; import com.adyen.model.balanceplatform.PaginatedPaymentInstrumentsResponse; @@ -23,6 +24,7 @@ import com.adyen.model.balanceplatform.TransactionRulesResponse; import com.adyen.service.balanceplatform.AccountHolders; import com.adyen.service.balanceplatform.BalanceAccounts; +import com.adyen.service.balanceplatform.BankAccountValidation; import com.adyen.service.balanceplatform.General; import com.adyen.service.balanceplatform.PaymentInstrumentGroups; import com.adyen.service.balanceplatform.PaymentInstruments; @@ -170,7 +172,7 @@ public void BalanceAccountsListSweepsTest() throws Exception { @Test public void BalanceAccountsCreateSweepTest() throws Exception { - Client client = createMockClientFromFile("mocks/balancePlatform/BalanceSweepConfigurationsResponse.json"); + Client client = createMockClientFromFile("mocks/balancePlatform/SweepConfigurationV2.json"); BalanceAccounts service = new BalanceAccounts(client); SweepConfigurationV2 request = SweepConfigurationV2.fromJson("{\n" + " \"counterparty\": {\n" + @@ -188,9 +190,9 @@ public void BalanceAccountsCreateSweepTest() throws Exception { " \"id\": \"SWPC4227C224555B5FTD2NT2JV4WN5\",\n" + " \"status\": \"active\"\n" + "}"); - BalanceSweepConfigurationsResponse response = service.createSweep("AH32272223222B59K6ZKBBFNQ", request); - assertEquals("SWPC4227C224555B5FTD2NT2JV4WN5", response.getSweeps().get(0).getId()); - assertEquals("BA32272223222B5FTD2KR6TJD", response.getSweeps().get(0).getCounterparty().getBalanceAccountId()); + SweepConfigurationV2 response = service.createSweep("AH32272223222B59K6ZKBBFNQ", request); + assertEquals("SWPC4227C224555B5FTD2NT2JV4WN5", response.getId()); + assertEquals(SweepConfigurationV2.StatusEnum.ACTIVE, response.getStatus()); } @Test @@ -391,4 +393,13 @@ public void TransactionRulesDeleteTest() throws Exception { TransactionRules service = new TransactionRules(client); service.delete("TR3227C223222B5FCB756DV9H"); } + + @Test + public void ValidateBankAccountIdentificationTest() throws Exception { + Client client = createMockClientFromFile("mocks/balancePlatform/TransactionRule.json"); + BankAccountValidation service = new BankAccountValidation(client); + service.validateBankAccountIdentification(new BankAccountIdentificationValidationRequest()); + } + + } \ No newline at end of file From 3d7a575f9ceb2c53bd872c2eece74cc42c571f4d Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Fri, 21 Apr 2023 14:44:46 +0200 Subject: [PATCH 14/32] ITT-141 Automating Services in Java Lib (#1001) * first improvements to the templates * cleanup * remove random import * add overload * fixed the overload params * update the method annotation * small fix to template * add support for liveurlprefix in endpoint * throw error for null path param values * cleanup * Revert "cleanup" This reverts commit 48d1c3103a21788e463742d0ef979c179d00dae3. * remove test * styling * add support for single file services * minor fix * finished templates and tested it on checkout * ignore generated files * order the method params better * add extra url test * changed service suffix to -Api * change makefile * Update Makefile Co-authored-by: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com> * Update Makefile Co-authored-by: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com> * Update src/main/java/com/adyen/Service.java --------- Co-authored-by: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com> --- Makefile | 73 +++++- checkstyle-suppressions.xml | 4 + pom.xml | 1 + src/main/java/com/adyen/Client.java | 1 + src/main/java/com/adyen/Service.java | 24 ++ .../com/adyen/model/checkout/AchDetails.java | 4 +- .../model/checkout/AdditionalDataLodging.java | 68 ++--- .../model/checkout/AuthenticationData.java | 10 +- .../java/com/adyen/model/checkout/Card.java | 13 +- .../checkout/CheckoutBalanceCheckRequest.java | 10 +- .../checkout/CheckoutCancelOrderRequest.java | 12 +- .../CreateCheckoutSessionRequest.java | 10 +- .../CreateCheckoutSessionResponse.java | 10 +- .../checkout/CreatePaymentCaptureRequest.java | 4 +- .../checkout/CreatePaymentLinkRequest.java | 44 +++- .../checkout/CreatePaymentRefundRequest.java | 4 +- ...koutOrder.java => EncryptedOrderData.java} | 56 ++-- .../java/com/adyen/model/checkout/JSON.java | 2 +- .../checkout/PaymentCaptureResource.java | 4 +- .../adyen/model/checkout/PaymentDetails.java | 6 - .../checkout/PaymentDonationRequest.java | 71 +++-- .../model/checkout/PaymentLinkResponse.java | 44 +++- .../model/checkout/PaymentMethodsRequest.java | 20 +- .../model/checkout/PaymentRefundResource.java | 4 +- .../adyen/model/checkout/PaymentRequest.java | 71 +++-- .../model/checkout/PaymentSetupRequest.java | 63 ++++- .../checkout/PlatformChargebackLogic.java | 35 ++- .../checkout/StoredPaymentMethodDetails.java | 6 +- .../checkout/ClassicCheckoutSdkApi.java | 99 +++++++ .../service/checkout/ModificationsApi.java | 247 ++++++++++++++++++ .../com/adyen/service/checkout/OrdersApi.java | 120 +++++++++ .../service/checkout/PaymentLinksApi.java | 131 ++++++++++ .../adyen/service/checkout/PaymentsApi.java | 207 +++++++++++++++ .../adyen/service/checkout/RecurringApi.java | 114 ++++++++ .../adyen/service/checkout/UtilityApi.java | 95 +++++++ .../com/adyen/service/resource/Resource.java | 1 + src/test/java/com/adyen/CheckoutTest.java | 126 ++++----- .../deleteStoredPaymentMethodResponse.json | 21 ++ templates/libraries/okhttp-gson/api.mustache | 81 +++--- .../okhttp-gson/api_overload.mustache | 2 + .../okhttp-gson/api_overload_invoke.mustache | 2 + .../okhttp-gson/api_parameters.mustache | 2 + .../libraries/okhttp-gson/api_single.mustache | 73 ++++++ .../okhttp-gson/api_summary.mustache | 25 ++ .../okhttp-gson/api_summary_overload.mustache | 21 ++ templates/libraries/okhttp-gson/config.yaml | 6 + 46 files changed, 1748 insertions(+), 299 deletions(-) create mode 100644 checkstyle-suppressions.xml rename src/main/java/com/adyen/model/checkout/{CheckoutOrder.java => EncryptedOrderData.java} (77%) create mode 100644 src/main/java/com/adyen/service/checkout/ClassicCheckoutSdkApi.java create mode 100644 src/main/java/com/adyen/service/checkout/ModificationsApi.java create mode 100644 src/main/java/com/adyen/service/checkout/OrdersApi.java create mode 100644 src/main/java/com/adyen/service/checkout/PaymentLinksApi.java create mode 100644 src/main/java/com/adyen/service/checkout/PaymentsApi.java create mode 100644 src/main/java/com/adyen/service/checkout/RecurringApi.java create mode 100644 src/main/java/com/adyen/service/checkout/UtilityApi.java create mode 100644 src/test/resources/mocks/checkout/deleteStoredPaymentMethodResponse.json create mode 100644 templates/libraries/okhttp-gson/api_overload.mustache create mode 100644 templates/libraries/okhttp-gson/api_overload_invoke.mustache create mode 100644 templates/libraries/okhttp-gson/api_parameters.mustache create mode 100644 templates/libraries/okhttp-gson/api_single.mustache create mode 100644 templates/libraries/okhttp-gson/api_summary.mustache create mode 100644 templates/libraries/okhttp-gson/api_summary_overload.mustache create mode 100644 templates/libraries/okhttp-gson/config.yaml diff --git a/Makefile b/Makefile index 8cc4e0062..eb94ecf29 100644 --- a/Makefile +++ b/Makefile @@ -5,22 +5,29 @@ openapi-generator-cli:=java -jar $(openapi-generator-jar) generator:=java library:=okhttp-gson -services:=balanceplatform binlookup checkout legalentitymanagement management payments payout recurring transfers +modelGen:=balanceplatform binlookup checkout legalentitymanagement management payments payout recurring transfers models:=src/main/java/com/adyen/model output:=target/out # Generate models (for each service) -models: $(services) +models: $(modelGen) -binlookup: spec=BinLookupService-v52 +balancecontrol: spec=BalanceControlService-v1 +balancecontrol: smallServiceName=BalanceControlApi +binlookup: spec=BinLookupService-v54 +binlookup: smallServiceName=BinLookupApi checkout: spec=CheckoutService-v70 -storedValue: spec=StoredValueService-v46 +dataprotection: spec=DataProtectionService-v1 +dataprotection: smallServiceName=DataProtectionApi +storedvalue: spec=StoredValueService-v46 +storedvalue: smallServiceName=StoredValueApi posterminalmanagement: spec=TfmAPIService-v1 +posterminalmanagement: smallServiceName=PosTerminalManagementApi payments: spec=PaymentService-v68 recurring: spec=RecurringService-v68 +recurring: smallServiceName=RecurringApi payout: spec=PayoutService-v68 management: spec=ManagementService-v1 -management: resourceClass=Management balanceplatform: spec=BalancePlatformService-v2 transfers: spec=TransferService-v3 legalentitymanagement: spec=LegalEntityService-v2 @@ -52,6 +59,62 @@ $(services): target/spec $(openapi-generator-jar) mv $(output)/$(models)/$@ $(models)/$@ mv $(output)/$(models)/JSON.java $(models)/$@ +# Full service + models automation +bigServices:=balanceplatform checkout storedValue payments payout management legalentitymanagement transfers +singleFileServices:=balancecontrol binlookup dataprotection storedvalue posterminalmanagement recurring + +services: $(bigServices) $(singleFileServices) + +$(bigServices): target/spec $(openapi-generator-jar) + rm -rf $(models)/$@ $(output) + rm -rf src/main/java/com/adyen/service/$@ $(output) + $(openapi-generator-cli) generate \ + -i target/spec/json/$(spec).json \ + -g $(generator) \ + -t templates \ + -o $(output) \ + --reserved-words-mappings configuration=configuration \ + --ignore-file-override ./.openapi-generator-ignore \ + --skip-validate-spec \ + --model-package $(subst /,.,com.adyen.model.$@) \ + --library $(library) \ + --api-package com.adyen.service.$@ \ + --api-name-suffix Api \ + --global-property modelDocs=false \ + --global-property modelTests=false \ + --additional-properties=dateLibrary=java8 \ + --additional-properties=serializationLibrary=gson \ + --additional-properties=openApiNullable=false + mv $(output)/$(models)/$@ $(models)/$@ + mv $(output)/src/main/java/com/adyen/service/JSON.java $(models)/$@ + mv $(output)/src/main/java/com/adyen/service/$@ src/main/java/com/adyen/service/$@ + +$(singleFileServices): target/spec $(openapi-generator-jar) + rm -rf $(models)/$@ $(output) + rm -rf src/main/java/com/adyen/service/$@ $(output) + $(openapi-generator-cli) generate \ + -i target/spec/json/$(spec).json \ + -g $(generator) \ + -c templates/libraries/okhttp-gson/config.yaml \ + -o $(output) \ + --reserved-words-mappings configuration=configuration \ + --ignore-file-override ./.openapi-generator-ignore \ + --skip-validate-spec \ + --model-package $(subst /,.,com.adyen.model.$@) \ + --library $(library) \ + --additional-properties customApi=$@ \ + --api-package com.adyen.service \ + --api-name-suffix Api \ + --global-property modelDocs=false \ + --global-property modelTests=false \ + --additional-properties=dateLibrary=java8 \ + --additional-properties=serializationLibrary=gson \ + --additional-properties=openApiNullable=false \ + --additional-properties=smallServiceName=$(smallServiceName) + mv $(output)/$(models)/$@ $(models)/$@ + mv $(output)/src/main/java/com/adyen/JSON.java $(models)/$@ + mv $(output)/src/main/java/com/adyen/service/*Single.java src/main/java/com/adyen/service/$(smallServiceName).java + # Checkout spec (and patch version) target/spec: diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml new file mode 100644 index 000000000..0c39a6b59 --- /dev/null +++ b/checkstyle-suppressions.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 70bf7e3b5..50136fb64 100644 --- a/pom.xml +++ b/pom.xml @@ -145,6 +145,7 @@ 3.2.1 checkstyle.xml + checkstyle-suppressions.xml true true diff --git a/src/main/java/com/adyen/Client.java b/src/main/java/com/adyen/Client.java index 16d866b8d..9c441cf11 100644 --- a/src/main/java/com/adyen/Client.java +++ b/src/main/java/com/adyen/Client.java @@ -216,6 +216,7 @@ public void setEnvironment(Environment environment, String liveEndpointUrlPrefix this.config.setEnvironment(environment); this.config.setMarketPayEndpoint(MARKETPAY_ENDPOINT_LIVE); if (liveEndpointUrlPrefix != null && !liveEndpointUrlPrefix.isEmpty()) { + this.config.liveEndpointUrlPrefix = liveEndpointUrlPrefix; this.config.setEndpoint(ENDPOINT_PROTOCOL + liveEndpointUrlPrefix + ENDPOINT_LIVE_SUFFIX); this.config.setCheckoutEndpoint(ENDPOINT_PROTOCOL + liveEndpointUrlPrefix + CHECKOUT_ENDPOINT_LIVE_SUFFIX); } else { diff --git a/src/main/java/com/adyen/Service.java b/src/main/java/com/adyen/Service.java index a83252d68..32ffabf52 100644 --- a/src/main/java/com/adyen/Service.java +++ b/src/main/java/com/adyen/Service.java @@ -20,6 +20,7 @@ */ package com.adyen; +import com.adyen.enums.Environment; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -49,4 +50,27 @@ public void setApiKeyRequired(boolean apiKeyRequired) { isApiKeyRequired = apiKeyRequired; } + protected String createBaseURL(String url) { + Config config = this.getClient().getConfig(); + if (config.getEnvironment() != Environment.LIVE) { + return url; + } + + if (url.contains("pal-")) { + if (config.getLiveEndpointUrlPrefix() == null) { + throw new IllegalArgumentException("please provide a live url prefix in the client"); + } + url = url.replaceFirst("https://pal-test.adyen.com/pal/servlet/", + "https://" + config.getLiveEndpointUrlPrefix() + "-pal-live.adyenpayments.com/pal/servlet/"); + } + + if (url.contains("checkout-")) { + if (config.getLiveEndpointUrlPrefix() == null) { + throw new IllegalArgumentException("please provide a live url prefix in the client"); + } + url = url.replaceFirst("https://checkout-test.adyen.com/", + "https://" + config.getLiveEndpointUrlPrefix() + "-checkout-live.adyenpayments.com/checkout/"); + } + return url.replaceFirst("-test", "-live"); + } } diff --git a/src/main/java/com/adyen/model/checkout/AchDetails.java b/src/main/java/com/adyen/model/checkout/AchDetails.java index 60d1b83ef..487623129 100644 --- a/src/main/java/com/adyen/model/checkout/AchDetails.java +++ b/src/main/java/com/adyen/model/checkout/AchDetails.java @@ -85,7 +85,9 @@ public class AchDetails { */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { - ACH("ach"); + ACH("ach"), + + ACH_PLAID("ach_plaid"); private String value; diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java b/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java index a7cba2be3..30198fa3a 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java @@ -126,10 +126,10 @@ public AdditionalDataLodging lodgingCheckInDate(String lodgingCheckInDate) { } /** - * The arrival date. * Date format: `yyyyMMdd` + * The arrival date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. * @return lodgingCheckInDate **/ - @ApiModelProperty(value = "The arrival date. * Date format: `yyyyMMdd`") + @ApiModelProperty(value = "The arrival date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**.") public String getLodgingCheckInDate() { return lodgingCheckInDate; @@ -148,10 +148,10 @@ public AdditionalDataLodging lodgingCheckOutDate(String lodgingCheckOutDate) { } /** - * The departure date. * Date format: `yyyyMMdd` + * The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. * @return lodgingCheckOutDate **/ - @ApiModelProperty(value = "The departure date. * Date format: `yyyyMMdd`") + @ApiModelProperty(value = "The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**.") public String getLodgingCheckOutDate() { return lodgingCheckOutDate; @@ -170,10 +170,10 @@ public AdditionalDataLodging lodgingCustomerServiceTollFreeNumber(String lodging } /** - * The toll free phone number for the hotel/lodgings. * Format: Alphanumeric * maxLength: 17 + * The toll-free phone number for the lodging. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail. * @return lodgingCustomerServiceTollFreeNumber **/ - @ApiModelProperty(value = "The toll free phone number for the hotel/lodgings. * Format: Alphanumeric * maxLength: 17") + @ApiModelProperty(value = "The toll-free phone number for the lodging. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail.") public String getLodgingCustomerServiceTollFreeNumber() { return lodgingCustomerServiceTollFreeNumber; @@ -192,10 +192,10 @@ public AdditionalDataLodging lodgingFireSafetyActIndicator(String lodgingFireSaf } /** - * Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: Alphabetic * maxLength: 1 + * Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: alphabetic. * Max length: 1 character. * @return lodgingFireSafetyActIndicator **/ - @ApiModelProperty(value = "Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: Alphabetic * maxLength: 1") + @ApiModelProperty(value = "Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: alphabetic. * Max length: 1 character.") public String getLodgingFireSafetyActIndicator() { return lodgingFireSafetyActIndicator; @@ -214,10 +214,10 @@ public AdditionalDataLodging lodgingFolioCashAdvances(String lodgingFolioCashAdv } /** - * The folio cash advances. * Format: Numeric * maxLength: 12 + * The folio cash advances. * Format: numeric. * Max length: 12 characters. * @return lodgingFolioCashAdvances **/ - @ApiModelProperty(value = "The folio cash advances. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "The folio cash advances. * Format: numeric. * Max length: 12 characters.") public String getLodgingFolioCashAdvances() { return lodgingFolioCashAdvances; @@ -236,10 +236,10 @@ public AdditionalDataLodging lodgingFolioNumber(String lodgingFolioNumber) { } /** - * Card acceptor’s internal invoice or billing ID reference number. * Format: Alphanumeric * maxLength: 25 + * The card acceptor’s internal invoice or billing ID reference number. * Format: alphanumeric. * Max length: 25 characters. * @return lodgingFolioNumber **/ - @ApiModelProperty(value = "Card acceptor’s internal invoice or billing ID reference number. * Format: Alphanumeric * maxLength: 25") + @ApiModelProperty(value = "The card acceptor’s internal invoice or billing ID reference number. * Format: alphanumeric. * Max length: 25 characters.") public String getLodgingFolioNumber() { return lodgingFolioNumber; @@ -258,10 +258,10 @@ public AdditionalDataLodging lodgingFoodBeverageCharges(String lodgingFoodBevera } /** - * Any charges for food and beverages associated with the booking. * Format: Numeric * maxLength: 12 + * The additional charges for food and beverages associated with the booking. * Format: numeric. * Max length: 12 characters. * @return lodgingFoodBeverageCharges **/ - @ApiModelProperty(value = "Any charges for food and beverages associated with the booking. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "The additional charges for food and beverages associated with the booking. * Format: numeric. * Max length: 12 characters.") public String getLodgingFoodBeverageCharges() { return lodgingFoodBeverageCharges; @@ -280,10 +280,10 @@ public AdditionalDataLodging lodgingNoShowIndicator(String lodgingNoShowIndicato } /** - * Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). Value should be Y or N. * Format: Numeric * maxLength: 1 + * Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in. **N**: the customer checked in. * @return lodgingNoShowIndicator **/ - @ApiModelProperty(value = "Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). Value should be Y or N. * Format: Numeric * maxLength: 1") + @ApiModelProperty(value = "Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in. **N**: the customer checked in.") public String getLodgingNoShowIndicator() { return lodgingNoShowIndicator; @@ -302,10 +302,10 @@ public AdditionalDataLodging lodgingPrepaidExpenses(String lodgingPrepaidExpense } /** - * Prepaid expenses for the booking. * Format: Numeric * maxLength: 12 + * The prepaid expenses for the booking. * Format: numeric. * Max length: 12 characters. * @return lodgingPrepaidExpenses **/ - @ApiModelProperty(value = "Prepaid expenses for the booking. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "The prepaid expenses for the booking. * Format: numeric. * Max length: 12 characters.") public String getLodgingPrepaidExpenses() { return lodgingPrepaidExpenses; @@ -324,10 +324,10 @@ public AdditionalDataLodging lodgingPropertyPhoneNumber(String lodgingPropertyPh } /** - * Identifies specific lodging property location by its local phone number. * Format: Alphanumeric * maxLength: 17 + * Identifies the location of the lodging by its local phone number. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail. * @return lodgingPropertyPhoneNumber **/ - @ApiModelProperty(value = "Identifies specific lodging property location by its local phone number. * Format: Alphanumeric * maxLength: 17") + @ApiModelProperty(value = "Identifies the location of the lodging by its local phone number. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail.") public String getLodgingPropertyPhoneNumber() { return lodgingPropertyPhoneNumber; @@ -346,10 +346,10 @@ public AdditionalDataLodging lodgingRoom1NumberOfNights(String lodgingRoom1Numbe } /** - * Total number of nights the room will be rented. * Format: Numeric * maxLength: 4 + * The total number of nights the room is booked for. * Format: numeric. * Max length: 4 characters. * @return lodgingRoom1NumberOfNights **/ - @ApiModelProperty(value = "Total number of nights the room will be rented. * Format: Numeric * maxLength: 4") + @ApiModelProperty(value = "The total number of nights the room is booked for. * Format: numeric. * Max length: 4 characters.") public String getLodgingRoom1NumberOfNights() { return lodgingRoom1NumberOfNights; @@ -368,10 +368,10 @@ public AdditionalDataLodging lodgingRoom1Rate(String lodgingRoom1Rate) { } /** - * The rate of the room. * Format: Numeric * maxLength: 12 + * The rate of the room. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). * @return lodgingRoom1Rate **/ - @ApiModelProperty(value = "The rate of the room. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "The rate of the room. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes).") public String getLodgingRoom1Rate() { return lodgingRoom1Rate; @@ -390,10 +390,10 @@ public AdditionalDataLodging lodgingRoom1Tax(String lodgingRoom1Tax) { } /** - * The total amount of tax to be paid. * Format: Numeric * maxLength: 12 + * The total amount of tax to be paid. * Format: numeric. * Max length: 12 chracters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). * @return lodgingRoom1Tax **/ - @ApiModelProperty(value = "The total amount of tax to be paid. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "The total amount of tax to be paid. * Format: numeric. * Max length: 12 chracters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes).") public String getLodgingRoom1Tax() { return lodgingRoom1Tax; @@ -412,10 +412,10 @@ public AdditionalDataLodging lodgingTotalRoomTax(String lodgingTotalRoomTax) { } /** - * Total room tax amount. * Format: Numeric * maxLength: 12 + * The total room tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). * @return lodgingTotalRoomTax **/ - @ApiModelProperty(value = "Total room tax amount. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "The total room tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes).") public String getLodgingTotalRoomTax() { return lodgingTotalRoomTax; @@ -434,10 +434,10 @@ public AdditionalDataLodging lodgingTotalTax(String lodgingTotalTax) { } /** - * Total tax amount. * Format: Numeric * maxLength: 12 + * The total tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). * @return lodgingTotalTax **/ - @ApiModelProperty(value = "Total tax amount. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "The total tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes).") public String getLodgingTotalTax() { return lodgingTotalTax; @@ -456,10 +456,10 @@ public AdditionalDataLodging travelEntertainmentAuthDataDuration(String travelEn } /** - * Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2 + * The number of nights. This should be included in the auth message. * Format: numeric. * Max length: 2 characters. * @return travelEntertainmentAuthDataDuration **/ - @ApiModelProperty(value = "Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2") + @ApiModelProperty(value = "The number of nights. This should be included in the auth message. * Format: numeric. * Max length: 2 characters.") public String getTravelEntertainmentAuthDataDuration() { return travelEntertainmentAuthDataDuration; @@ -478,10 +478,10 @@ public AdditionalDataLodging travelEntertainmentAuthDataMarket(String travelEnte } /** - * Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 + * Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: alphanumeric. * Max length: 1 character. * @return travelEntertainmentAuthDataMarket **/ - @ApiModelProperty(value = "Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1") + @ApiModelProperty(value = "Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: alphanumeric. * Max length: 1 character.") public String getTravelEntertainmentAuthDataMarket() { return travelEntertainmentAuthDataMarket; diff --git a/src/main/java/com/adyen/model/checkout/AuthenticationData.java b/src/main/java/com/adyen/model/checkout/AuthenticationData.java index 07a2fead7..6facf7dc1 100644 --- a/src/main/java/com/adyen/model/checkout/AuthenticationData.java +++ b/src/main/java/com/adyen/model/checkout/AuthenticationData.java @@ -50,7 +50,7 @@ public class AuthenticationData { /** - * Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. * **preferNo**: Do not perform 3D Secure authentication if not required by PSD2 SCA or other national regulations. + * Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. */ @JsonAdapter(AttemptAuthenticationEnum.Adapter.class) public enum AttemptAuthenticationEnum { @@ -118,10 +118,10 @@ public AuthenticationData attemptAuthentication(AttemptAuthenticationEnum attemp } /** - * Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. * **preferNo**: Do not perform 3D Secure authentication if not required by PSD2 SCA or other national regulations. + * Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. * @return attemptAuthentication **/ - @ApiModelProperty(value = "Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined. * **preferNo**: Do not perform 3D Secure authentication if not required by PSD2 SCA or other national regulations.") + @ApiModelProperty(value = "Indicates when 3D Secure authentication should be attempted. This overrides all other rules, including [Dynamic 3D Secure settings](https://docs.adyen.com/risk-management/dynamic-3d-secure). Possible values: * **always**: Perform 3D Secure authentication. * **never**: Don't perform 3D Secure authentication. If PSD2 SCA or other national regulations require authentication, the transaction gets declined.") public AttemptAuthenticationEnum getAttemptAuthentication() { return attemptAuthentication; @@ -140,10 +140,10 @@ public AuthenticationData authenticationOnly(Boolean authenticationOnly) { } /** - * If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: *false**. + * If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: **false**. * @return authenticationOnly **/ - @ApiModelProperty(value = "If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: *false**.") + @ApiModelProperty(value = "If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. Default: **false**.") public Boolean getAuthenticationOnly() { return authenticationOnly; diff --git a/src/main/java/com/adyen/model/checkout/Card.java b/src/main/java/com/adyen/model/checkout/Card.java index 3c1db4139..0a2112b34 100644 --- a/src/main/java/com/adyen/model/checkout/Card.java +++ b/src/main/java/com/adyen/model/checkout/Card.java @@ -137,7 +137,7 @@ public Card expiryYear(String expiryYear) { * The card expiry year. Format: 4 digits. For example: 2020 * @return expiryYear **/ - @ApiModelProperty(required = true, value = "The card expiry year. Format: 4 digits. For example: 2020") + @ApiModelProperty(value = "The card expiry year. Format: 4 digits. For example: 2020") public String getExpiryYear() { return expiryYear; @@ -159,7 +159,7 @@ public Card holderName(String holderName) { * The name of the cardholder, as printed on the card. * @return holderName **/ - @ApiModelProperty(required = true, value = "The name of the cardholder, as printed on the card.") + @ApiModelProperty(value = "The name of the cardholder, as printed on the card.") public String getHolderName() { return holderName; @@ -329,8 +329,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("expiryYear"); - openapiRequiredFields.add("holderName"); } /** @@ -355,13 +353,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Card` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Card.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } // validate the optional field cvc if (jsonObj.get("cvc") != null && !jsonObj.get("cvc").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `cvc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvc").toString())); diff --git a/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java b/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java index f11a2e195..931b2c8ab 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java @@ -163,7 +163,7 @@ public class CheckoutBalanceCheckRequest { private Recurring recurring; /** - * Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. */ @JsonAdapter(RecurringProcessingModelEnum.Adapter.class) public enum RecurringProcessingModelEnum { @@ -698,10 +698,10 @@ public CheckoutBalanceCheckRequest putLocalizedShopperStatementItem(String key, } /** - * This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. * @return localizedShopperStatement **/ - @ApiModelProperty(value = "This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned.") + @ApiModelProperty(value = "This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions.") public Map getLocalizedShopperStatement() { return localizedShopperStatement; @@ -909,10 +909,10 @@ public CheckoutBalanceCheckRequest recurringProcessingModel(RecurringProcessingM } /** - * Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. * @return recurringProcessingModel **/ - @ApiModelProperty(value = "Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. ") + @ApiModelProperty(value = "Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. ") public RecurringProcessingModelEnum getRecurringProcessingModel() { return recurringProcessingModel; diff --git a/src/main/java/com/adyen/model/checkout/CheckoutCancelOrderRequest.java b/src/main/java/com/adyen/model/checkout/CheckoutCancelOrderRequest.java index 5893e1e78..648f7b6cd 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutCancelOrderRequest.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutCancelOrderRequest.java @@ -14,7 +14,7 @@ import java.util.Objects; import java.util.Arrays; -import com.adyen.model.checkout.CheckoutOrder; +import com.adyen.model.checkout.EncryptedOrderData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -55,7 +55,7 @@ public class CheckoutCancelOrderRequest { public static final String SERIALIZED_NAME_ORDER = "order"; @SerializedName(SERIALIZED_NAME_ORDER) - private CheckoutOrder order; + private EncryptedOrderData order; public CheckoutCancelOrderRequest() { } @@ -82,7 +82,7 @@ public void setMerchantAccount(String merchantAccount) { } - public CheckoutCancelOrderRequest order(CheckoutOrder order) { + public CheckoutCancelOrderRequest order(EncryptedOrderData order) { this.order = order; return this; @@ -94,12 +94,12 @@ public CheckoutCancelOrderRequest order(CheckoutOrder order) { **/ @ApiModelProperty(required = true, value = "") - public CheckoutOrder getOrder() { + public EncryptedOrderData getOrder() { return order; } - public void setOrder(CheckoutOrder order) { + public void setOrder(EncryptedOrderData order) { this.order = order; } @@ -195,7 +195,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field `order` if (jsonObj.getAsJsonObject("order") != null) { - CheckoutOrder.validateJsonObject(jsonObj.getAsJsonObject("order")); + EncryptedOrderData.validateJsonObject(jsonObj.getAsJsonObject("order")); } } diff --git a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java index dde8665c4..fecbb8021 100644 --- a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java @@ -575,10 +575,10 @@ public CreateCheckoutSessionRequest addAllowedPaymentMethodsItem(String allowedP } /** - * List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` * @return allowedPaymentMethods **/ - @ApiModelProperty(value = "List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`") + @ApiModelProperty(value = "List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`") public List getAllowedPaymentMethods() { return allowedPaymentMethods; @@ -693,10 +693,10 @@ public CreateCheckoutSessionRequest addBlockedPaymentMethodsItem(String blockedP } /** - * List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` * @return blockedPaymentMethods **/ - @ApiModelProperty(value = "List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`") + @ApiModelProperty(value = "List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`") public List getBlockedPaymentMethods() { return blockedPaymentMethods; @@ -1695,7 +1695,9 @@ public CreateCheckoutSessionRequest threeDSAuthenticationOnly(Boolean threeDSAut /** * If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. * @return threeDSAuthenticationOnly + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation.") public Boolean getThreeDSAuthenticationOnly() { diff --git a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java index 15ca61ece..d0d5a4fba 100644 --- a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java +++ b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java @@ -642,10 +642,10 @@ public CreateCheckoutSessionResponse addAllowedPaymentMethodsItem(String allowed } /** - * List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` * @return allowedPaymentMethods **/ - @ApiModelProperty(value = "List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`") + @ApiModelProperty(value = "List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`") public List getAllowedPaymentMethods() { return allowedPaymentMethods; @@ -760,10 +760,10 @@ public CreateCheckoutSessionResponse addBlockedPaymentMethodsItem(String blocked } /** - * List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` * @return blockedPaymentMethods **/ - @ApiModelProperty(value = "List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`") + @ApiModelProperty(value = "List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`") public List getBlockedPaymentMethods() { return blockedPaymentMethods; @@ -1819,7 +1819,9 @@ public CreateCheckoutSessionResponse threeDSAuthenticationOnly(Boolean threeDSAu /** * If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. * @return threeDSAuthenticationOnly + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation.") public Boolean getThreeDSAuthenticationOnly() { diff --git a/src/main/java/com/adyen/model/checkout/CreatePaymentCaptureRequest.java b/src/main/java/com/adyen/model/checkout/CreatePaymentCaptureRequest.java index 99c6ad4a7..571bf41e2 100644 --- a/src/main/java/com/adyen/model/checkout/CreatePaymentCaptureRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreatePaymentCaptureRequest.java @@ -113,10 +113,10 @@ public CreatePaymentCaptureRequest addLineItemsItem(LineItem lineItemsItem) { } /** - * Price and product information of the captured items, required for [partial captures](https://docs.adyen.com/online-payments/capture#partial-capture). > This field is required for partial captures with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. * @return lineItems **/ - @ApiModelProperty(value = "Price and product information of the captured items, required for [partial captures](https://docs.adyen.com/online-payments/capture#partial-capture). > This field is required for partial captures with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome.") + @ApiModelProperty(value = "Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.") public List getLineItems() { return lineItems; diff --git a/src/main/java/com/adyen/model/checkout/CreatePaymentLinkRequest.java b/src/main/java/com/adyen/model/checkout/CreatePaymentLinkRequest.java index 9b0c7a48a..66e8f7442 100644 --- a/src/main/java/com/adyen/model/checkout/CreatePaymentLinkRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreatePaymentLinkRequest.java @@ -16,6 +16,7 @@ import java.util.Arrays; import com.adyen.model.checkout.Address; import com.adyen.model.checkout.Amount; +import com.adyen.model.checkout.ApplicationInfo; import com.adyen.model.checkout.InstallmentOption; import com.adyen.model.checkout.LineItem; import com.adyen.model.checkout.Name; @@ -69,6 +70,10 @@ public class CreatePaymentLinkRequest { @SerializedName(SERIALIZED_NAME_AMOUNT) private Amount amount; + public static final String SERIALIZED_NAME_APPLICATION_INFO = "applicationInfo"; + @SerializedName(SERIALIZED_NAME_APPLICATION_INFO) + private ApplicationInfo applicationInfo; + public static final String SERIALIZED_NAME_BILLING_ADDRESS = "billingAddress"; @SerializedName(SERIALIZED_NAME_BILLING_ADDRESS) private Address billingAddress; @@ -378,10 +383,10 @@ public CreatePaymentLinkRequest addAllowedPaymentMethodsItem(String allowedPayme } /** - * List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` * @return allowedPaymentMethods **/ - @ApiModelProperty(value = "List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`") + @ApiModelProperty(value = "List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`") public List getAllowedPaymentMethods() { return allowedPaymentMethods; @@ -415,6 +420,28 @@ public void setAmount(Amount amount) { } + public CreatePaymentLinkRequest applicationInfo(ApplicationInfo applicationInfo) { + + this.applicationInfo = applicationInfo; + return this; + } + + /** + * Get applicationInfo + * @return applicationInfo + **/ + @ApiModelProperty(value = "") + + public ApplicationInfo getApplicationInfo() { + return applicationInfo; + } + + + public void setApplicationInfo(ApplicationInfo applicationInfo) { + this.applicationInfo = applicationInfo; + } + + public CreatePaymentLinkRequest billingAddress(Address billingAddress) { this.billingAddress = billingAddress; @@ -452,10 +479,10 @@ public CreatePaymentLinkRequest addBlockedPaymentMethodsItem(String blockedPayme } /** - * List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` * @return blockedPaymentMethods **/ - @ApiModelProperty(value = "List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`") + @ApiModelProperty(value = "List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`") public List getBlockedPaymentMethods() { return blockedPaymentMethods; @@ -1245,6 +1272,7 @@ public boolean equals(Object o) { CreatePaymentLinkRequest createPaymentLinkRequest = (CreatePaymentLinkRequest) o; return Objects.equals(this.allowedPaymentMethods, createPaymentLinkRequest.allowedPaymentMethods) && Objects.equals(this.amount, createPaymentLinkRequest.amount) && + Objects.equals(this.applicationInfo, createPaymentLinkRequest.applicationInfo) && Objects.equals(this.billingAddress, createPaymentLinkRequest.billingAddress) && Objects.equals(this.blockedPaymentMethods, createPaymentLinkRequest.blockedPaymentMethods) && Objects.equals(this.captureDelayHours, createPaymentLinkRequest.captureDelayHours) && @@ -1284,7 +1312,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(allowedPaymentMethods, amount, billingAddress, blockedPaymentMethods, captureDelayHours, countryCode, dateOfBirth, deliverAt, deliveryAddress, description, expiresAt, installmentOptions, lineItems, manualCapture, mcc, merchantAccount, merchantOrderReference, metadata, recurringProcessingModel, reference, requiredShopperFields, returnUrl, reusable, riskData, shopperEmail, shopperLocale, shopperName, shopperReference, shopperStatement, showRemovePaymentMethodButton, socialSecurityNumber, splitCardFundingSources, splits, store, storePaymentMethodMode, telephoneNumber, themeId); + return Objects.hash(allowedPaymentMethods, amount, applicationInfo, billingAddress, blockedPaymentMethods, captureDelayHours, countryCode, dateOfBirth, deliverAt, deliveryAddress, description, expiresAt, installmentOptions, lineItems, manualCapture, mcc, merchantAccount, merchantOrderReference, metadata, recurringProcessingModel, reference, requiredShopperFields, returnUrl, reusable, riskData, shopperEmail, shopperLocale, shopperName, shopperReference, shopperStatement, showRemovePaymentMethodButton, socialSecurityNumber, splitCardFundingSources, splits, store, storePaymentMethodMode, telephoneNumber, themeId); } @Override @@ -1293,6 +1321,7 @@ public String toString() { sb.append("class CreatePaymentLinkRequest {\n"); sb.append(" allowedPaymentMethods: ").append(toIndentedString(allowedPaymentMethods)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" applicationInfo: ").append(toIndentedString(applicationInfo)).append("\n"); sb.append(" billingAddress: ").append(toIndentedString(billingAddress)).append("\n"); sb.append(" blockedPaymentMethods: ").append(toIndentedString(blockedPaymentMethods)).append("\n"); sb.append(" captureDelayHours: ").append(toIndentedString(captureDelayHours)).append("\n"); @@ -1352,6 +1381,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("allowedPaymentMethods"); openapiFields.add("amount"); + openapiFields.add("applicationInfo"); openapiFields.add("billingAddress"); openapiFields.add("blockedPaymentMethods"); openapiFields.add("captureDelayHours"); @@ -1432,6 +1462,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.getAsJsonObject("amount") != null) { Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); } + // validate the optional field `applicationInfo` + if (jsonObj.getAsJsonObject("applicationInfo") != null) { + ApplicationInfo.validateJsonObject(jsonObj.getAsJsonObject("applicationInfo")); + } // validate the optional field `billingAddress` if (jsonObj.getAsJsonObject("billingAddress") != null) { Address.validateJsonObject(jsonObj.getAsJsonObject("billingAddress")); diff --git a/src/main/java/com/adyen/model/checkout/CreatePaymentRefundRequest.java b/src/main/java/com/adyen/model/checkout/CreatePaymentRefundRequest.java index 2e0b566d2..30a9c0598 100644 --- a/src/main/java/com/adyen/model/checkout/CreatePaymentRefundRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreatePaymentRefundRequest.java @@ -170,10 +170,10 @@ public CreatePaymentRefundRequest addLineItemsItem(LineItem lineItemsItem) { } /** - * Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. * @return lineItems **/ - @ApiModelProperty(value = "Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome.") + @ApiModelProperty(value = "Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.") public List getLineItems() { return lineItems; diff --git a/src/main/java/com/adyen/model/checkout/CheckoutOrder.java b/src/main/java/com/adyen/model/checkout/EncryptedOrderData.java similarity index 77% rename from src/main/java/com/adyen/model/checkout/CheckoutOrder.java rename to src/main/java/com/adyen/model/checkout/EncryptedOrderData.java index 53d8844b1..6119b38e5 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutOrder.java +++ b/src/main/java/com/adyen/model/checkout/EncryptedOrderData.java @@ -44,10 +44,10 @@ import com.adyen.model.checkout.JSON; /** - * CheckoutOrder + * EncryptedOrderData */ -public class CheckoutOrder { +public class EncryptedOrderData { public static final String SERIALIZED_NAME_ORDER_DATA = "orderData"; @SerializedName(SERIALIZED_NAME_ORDER_DATA) private String orderData; @@ -56,10 +56,10 @@ public class CheckoutOrder { @SerializedName(SERIALIZED_NAME_PSP_REFERENCE) private String pspReference; - public CheckoutOrder() { + public EncryptedOrderData() { } - public CheckoutOrder orderData(String orderData) { + public EncryptedOrderData orderData(String orderData) { this.orderData = orderData; return this; @@ -81,7 +81,7 @@ public void setOrderData(String orderData) { } - public CheckoutOrder pspReference(String pspReference) { + public EncryptedOrderData pspReference(String pspReference) { this.pspReference = pspReference; return this; @@ -112,9 +112,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CheckoutOrder checkoutOrder = (CheckoutOrder) o; - return Objects.equals(this.orderData, checkoutOrder.orderData) && - Objects.equals(this.pspReference, checkoutOrder.pspReference); + EncryptedOrderData encryptedOrderData = (EncryptedOrderData) o; + return Objects.equals(this.orderData, encryptedOrderData.orderData) && + Objects.equals(this.pspReference, encryptedOrderData.pspReference); } @Override @@ -125,7 +125,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CheckoutOrder {\n"); + sb.append("class EncryptedOrderData {\n"); sb.append(" orderData: ").append(toIndentedString(orderData)).append("\n"); sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); sb.append("}"); @@ -163,27 +163,27 @@ private String toIndentedString(Object o) { * Validates the JSON Object and throws an exception if issues found * * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CheckoutOrder + * @throws IOException if the JSON Object is invalid with respect to EncryptedOrderData */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { - if (CheckoutOrder.openapiRequiredFields.isEmpty()) { + if (EncryptedOrderData.openapiRequiredFields.isEmpty()) { return; } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in CheckoutOrder is not found in the empty JSON string", CheckoutOrder.openapiRequiredFields.toString())); + throw new IllegalArgumentException(String.format("The required field(s) %s in EncryptedOrderData is not found in the empty JSON string", EncryptedOrderData.openapiRequiredFields.toString())); } } Set> entries = jsonObj.entrySet(); // check to see if the JSON string contains additional fields for (Entry entry : entries) { - if (!CheckoutOrder.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutOrder` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + if (!EncryptedOrderData.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EncryptedOrderData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : CheckoutOrder.openapiRequiredFields) { + for (String requiredField : EncryptedOrderData.openapiRequiredFields) { if (jsonObj.get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); } @@ -202,22 +202,22 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!CheckoutOrder.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CheckoutOrder' and its subtypes + if (!EncryptedOrderData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EncryptedOrderData' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CheckoutOrder.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EncryptedOrderData.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, CheckoutOrder value) throws IOException { + public void write(JsonWriter out, EncryptedOrderData value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public CheckoutOrder read(JsonReader in) throws IOException { + public EncryptedOrderData read(JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); return thisAdapter.fromJsonTree(jsonObj); @@ -228,18 +228,18 @@ public CheckoutOrder read(JsonReader in) throws IOException { } /** - * Create an instance of CheckoutOrder given an JSON string + * Create an instance of EncryptedOrderData given an JSON string * * @param jsonString JSON string - * @return An instance of CheckoutOrder - * @throws IOException if the JSON string is invalid with respect to CheckoutOrder + * @return An instance of EncryptedOrderData + * @throws IOException if the JSON string is invalid with respect to EncryptedOrderData */ - public static CheckoutOrder fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CheckoutOrder.class); + public static EncryptedOrderData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EncryptedOrderData.class); } /** - * Convert an instance of CheckoutOrder to an JSON string + * Convert an instance of EncryptedOrderData to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/adyen/model/checkout/JSON.java b/src/main/java/com/adyen/model/checkout/JSON.java index e05f90fab..007ffd2cc 100644 --- a/src/main/java/com/adyen/model/checkout/JSON.java +++ b/src/main/java/com/adyen/model/checkout/JSON.java @@ -139,7 +139,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.CheckoutCreateOrderRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.CheckoutCreateOrderResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.CheckoutNativeRedirectAction.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.CheckoutOrder.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.CheckoutOrderResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.CheckoutQrCodeAction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.CheckoutRedirectAction.CustomTypeAdapterFactory()); @@ -169,6 +168,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.DotpayDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.DragonpayDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.EcontextVoucherDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.EncryptedOrderData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.ExternalPlatform.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.ForexQuote.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.FraudCheckResult.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/adyen/model/checkout/PaymentCaptureResource.java b/src/main/java/com/adyen/model/checkout/PaymentCaptureResource.java index e4b827c2d..97e25565e 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentCaptureResource.java +++ b/src/main/java/com/adyen/model/checkout/PaymentCaptureResource.java @@ -170,10 +170,10 @@ public PaymentCaptureResource addLineItemsItem(LineItem lineItemsItem) { } /** - * Price and product information of the captured items, required for [partial captures](https://docs.adyen.com/online-payments/capture#partial-capture). > This field is required for partial captures with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. * @return lineItems **/ - @ApiModelProperty(value = "Price and product information of the captured items, required for [partial captures](https://docs.adyen.com/online-payments/capture#partial-capture). > This field is required for partial captures with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome.") + @ApiModelProperty(value = "Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.") public List getLineItems() { return lineItems; diff --git a/src/main/java/com/adyen/model/checkout/PaymentDetails.java b/src/main/java/com/adyen/model/checkout/PaymentDetails.java index fe1b34a62..5d23f2a0e 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDetails.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDetails.java @@ -117,8 +117,6 @@ public enum TypeEnum { MOLPAY_EBANKING_VN("molpay_ebanking_VN"), - OPENBANKING_UK("openbanking_UK"), - PAYBYBANK("paybybank"), EBANKING_FI("ebanking_FI"), @@ -129,8 +127,6 @@ public enum TypeEnum { SWISH("swish"), - TWINT("twint"), - WALLEY("walley"), WALLEY_B2B("walley_b2b"), @@ -229,8 +225,6 @@ public enum TypeEnum { PROMPTPAY("promptpay"), - TWINT_POS("twint_pos"), - ALIPAY_HK("alipay_hk"), ALIPAY_HK_WEB("alipay_hk_web"), diff --git a/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java b/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java index 6ac40accf..2f8e9d64c 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java @@ -20,8 +20,8 @@ import com.adyen.model.checkout.ApplicationInfo; import com.adyen.model.checkout.AuthenticationData; import com.adyen.model.checkout.BrowserInfo; -import com.adyen.model.checkout.CheckoutOrder; import com.adyen.model.checkout.Company; +import com.adyen.model.checkout.EncryptedOrderData; import com.adyen.model.checkout.ForexQuote; import com.adyen.model.checkout.Installments; import com.adyen.model.checkout.LineItem; @@ -78,6 +78,10 @@ public class PaymentDonationRequest { @SerializedName(SERIALIZED_NAME_ACCOUNT_INFO) private AccountInfo accountInfo; + public static final String SERIALIZED_NAME_ADDITIONAL_AMOUNT = "additionalAmount"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_AMOUNT) + private Amount additionalAmount; + public static final String SERIALIZED_NAME_ADDITIONAL_DATA = "additionalData"; @SerializedName(SERIALIZED_NAME_ADDITIONAL_DATA) private Map additionalData = null; @@ -369,7 +373,7 @@ public IndustryUsageEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_ORDER = "order"; @SerializedName(SERIALIZED_NAME_ORDER) - private CheckoutOrder order; + private EncryptedOrderData order; public static final String SERIALIZED_NAME_ORDER_REFERENCE = "orderReference"; @SerializedName(SERIALIZED_NAME_ORDER_REFERENCE) @@ -396,7 +400,7 @@ public IndustryUsageEnum read(final JsonReader jsonReader) throws IOException { private String recurringFrequency; /** - * Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. */ @JsonAdapter(RecurringProcessingModelEnum.Adapter.class) public enum RecurringProcessingModelEnum { @@ -608,6 +612,28 @@ public void setAccountInfo(AccountInfo accountInfo) { } + public PaymentDonationRequest additionalAmount(Amount additionalAmount) { + + this.additionalAmount = additionalAmount; + return this; + } + + /** + * Get additionalAmount + * @return additionalAmount + **/ + @ApiModelProperty(value = "") + + public Amount getAdditionalAmount() { + return additionalAmount; + } + + + public void setAdditionalAmount(Amount additionalAmount) { + this.additionalAmount = additionalAmount; + } + + public PaymentDonationRequest additionalData(Map additionalData) { this.additionalData = additionalData; @@ -799,10 +825,10 @@ public PaymentDonationRequest checkoutAttemptId(String checkoutAttemptId) { } /** - * Checkout attempt ID that corresponds to the Id generated for tracking user payment journey. + * Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. * @return checkoutAttemptId **/ - @ApiModelProperty(value = "Checkout attempt ID that corresponds to the Id generated for tracking user payment journey.") + @ApiModelProperty(value = "Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey.") public String getCheckoutAttemptId() { return checkoutAttemptId; @@ -843,10 +869,12 @@ public PaymentDonationRequest conversionId(String conversionId) { } /** - * Conversion ID that corresponds to the Id generated for tracking user payment journey. + * Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. * @return conversionId + * @deprecated **/ - @ApiModelProperty(value = "Conversion ID that corresponds to the Id generated for tracking user payment journey.") + @Deprecated + @ApiModelProperty(value = "Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey.") public String getConversionId() { return conversionId; @@ -1225,10 +1253,10 @@ public PaymentDonationRequest addLineItemsItem(LineItem lineItemsItem) { } /** - * Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. * @return lineItems **/ - @ApiModelProperty(value = "Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome.") + @ApiModelProperty(value = "Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.") public List getLineItems() { return lineItems; @@ -1255,10 +1283,10 @@ public PaymentDonationRequest putLocalizedShopperStatementItem(String key, Strin } /** - * This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. * @return localizedShopperStatement **/ - @ApiModelProperty(value = "This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned.") + @ApiModelProperty(value = "This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions.") public Map getLocalizedShopperStatement() { return localizedShopperStatement; @@ -1432,7 +1460,7 @@ public void setMpiData(ThreeDSecureData mpiData) { } - public PaymentDonationRequest order(CheckoutOrder order) { + public PaymentDonationRequest order(EncryptedOrderData order) { this.order = order; return this; @@ -1444,12 +1472,12 @@ public PaymentDonationRequest order(CheckoutOrder order) { **/ @ApiModelProperty(value = "") - public CheckoutOrder getOrder() { + public EncryptedOrderData getOrder() { return order; } - public void setOrder(CheckoutOrder order) { + public void setOrder(EncryptedOrderData order) { this.order = order; } @@ -1593,10 +1621,10 @@ public PaymentDonationRequest recurringProcessingModel(RecurringProcessingModelE } /** - * Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. * @return recurringProcessingModel **/ - @ApiModelProperty(value = "Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. ") + @ApiModelProperty(value = "Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. ") public RecurringProcessingModelEnum getRecurringProcessingModel() { return recurringProcessingModel; @@ -2091,6 +2119,7 @@ public boolean equals(Object o) { } PaymentDonationRequest paymentDonationRequest = (PaymentDonationRequest) o; return Objects.equals(this.accountInfo, paymentDonationRequest.accountInfo) && + Objects.equals(this.additionalAmount, paymentDonationRequest.additionalAmount) && Objects.equals(this.additionalData, paymentDonationRequest.additionalData) && Objects.equals(this.amount, paymentDonationRequest.amount) && Objects.equals(this.applicationInfo, paymentDonationRequest.applicationInfo) && @@ -2160,7 +2189,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountInfo, additionalData, amount, applicationInfo, authenticationData, billingAddress, browserInfo, captureDelayHours, channel, checkoutAttemptId, company, conversionId, countryCode, dateOfBirth, dccQuote, deliveryAddress, deliveryDate, deviceFingerprint, donationAccount, donationOriginalPspReference, donationToken, enableOneClick, enablePayOut, enableRecurring, entityType, fraudOffset, industryUsage, installments, lineItems, localizedShopperStatement, mandate, mcc, merchantAccount, merchantOrderReference, merchantRiskIndicator, metadata, mpiData, order, orderReference, origin, paymentMethod, platformChargebackLogic, recurringExpiry, recurringFrequency, recurringProcessingModel, redirectFromIssuerMethod, redirectToIssuerMethod, reference, returnUrl, riskData, sessionValidity, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, shopperStatement, socialSecurityNumber, splits, store, storePaymentMethod, telephoneNumber, threeDS2RequestData, threeDSAuthenticationOnly, trustedShopper); + return Objects.hash(accountInfo, additionalAmount, additionalData, amount, applicationInfo, authenticationData, billingAddress, browserInfo, captureDelayHours, channel, checkoutAttemptId, company, conversionId, countryCode, dateOfBirth, dccQuote, deliveryAddress, deliveryDate, deviceFingerprint, donationAccount, donationOriginalPspReference, donationToken, enableOneClick, enablePayOut, enableRecurring, entityType, fraudOffset, industryUsage, installments, lineItems, localizedShopperStatement, mandate, mcc, merchantAccount, merchantOrderReference, merchantRiskIndicator, metadata, mpiData, order, orderReference, origin, paymentMethod, platformChargebackLogic, recurringExpiry, recurringFrequency, recurringProcessingModel, redirectFromIssuerMethod, redirectToIssuerMethod, reference, returnUrl, riskData, sessionValidity, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, shopperStatement, socialSecurityNumber, splits, store, storePaymentMethod, telephoneNumber, threeDS2RequestData, threeDSAuthenticationOnly, trustedShopper); } @Override @@ -2168,6 +2197,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PaymentDonationRequest {\n"); sb.append(" accountInfo: ").append(toIndentedString(accountInfo)).append("\n"); + sb.append(" additionalAmount: ").append(toIndentedString(additionalAmount)).append("\n"); sb.append(" additionalData: ").append(toIndentedString(additionalData)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" applicationInfo: ").append(toIndentedString(applicationInfo)).append("\n"); @@ -2256,6 +2286,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("accountInfo"); + openapiFields.add("additionalAmount"); openapiFields.add("additionalData"); openapiFields.add("amount"); openapiFields.add("applicationInfo"); @@ -2365,6 +2396,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.getAsJsonObject("accountInfo") != null) { AccountInfo.validateJsonObject(jsonObj.getAsJsonObject("accountInfo")); } + // validate the optional field `additionalAmount` + if (jsonObj.getAsJsonObject("additionalAmount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("additionalAmount")); + } // validate the optional field `amount` if (jsonObj.getAsJsonObject("amount") != null) { Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); @@ -2488,7 +2523,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field `order` if (jsonObj.getAsJsonObject("order") != null) { - CheckoutOrder.validateJsonObject(jsonObj.getAsJsonObject("order")); + EncryptedOrderData.validateJsonObject(jsonObj.getAsJsonObject("order")); } // validate the optional field orderReference if (jsonObj.get("orderReference") != null && !jsonObj.get("orderReference").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java b/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java index 8bb174df8..2d87a36e6 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java @@ -16,6 +16,7 @@ import java.util.Arrays; import com.adyen.model.checkout.Address; import com.adyen.model.checkout.Amount; +import com.adyen.model.checkout.ApplicationInfo; import com.adyen.model.checkout.InstallmentOption; import com.adyen.model.checkout.LineItem; import com.adyen.model.checkout.Name; @@ -69,6 +70,10 @@ public class PaymentLinkResponse { @SerializedName(SERIALIZED_NAME_AMOUNT) private Amount amount; + public static final String SERIALIZED_NAME_APPLICATION_INFO = "applicationInfo"; + @SerializedName(SERIALIZED_NAME_APPLICATION_INFO) + private ApplicationInfo applicationInfo; + public static final String SERIALIZED_NAME_BILLING_ADDRESS = "billingAddress"; @SerializedName(SERIALIZED_NAME_BILLING_ADDRESS) private Address billingAddress; @@ -457,10 +462,10 @@ public PaymentLinkResponse addAllowedPaymentMethodsItem(String allowedPaymentMet } /** - * List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` * @return allowedPaymentMethods **/ - @ApiModelProperty(value = "List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`") + @ApiModelProperty(value = "List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`") public List getAllowedPaymentMethods() { return allowedPaymentMethods; @@ -494,6 +499,28 @@ public void setAmount(Amount amount) { } + public PaymentLinkResponse applicationInfo(ApplicationInfo applicationInfo) { + + this.applicationInfo = applicationInfo; + return this; + } + + /** + * Get applicationInfo + * @return applicationInfo + **/ + @ApiModelProperty(value = "") + + public ApplicationInfo getApplicationInfo() { + return applicationInfo; + } + + + public void setApplicationInfo(ApplicationInfo applicationInfo) { + this.applicationInfo = applicationInfo; + } + + public PaymentLinkResponse billingAddress(Address billingAddress) { this.billingAddress = billingAddress; @@ -531,10 +558,10 @@ public PaymentLinkResponse addBlockedPaymentMethodsItem(String blockedPaymentMet } /** - * List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` * @return blockedPaymentMethods **/ - @ApiModelProperty(value = "List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`") + @ApiModelProperty(value = "List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`") public List getBlockedPaymentMethods() { return blockedPaymentMethods; @@ -1394,6 +1421,7 @@ public boolean equals(Object o) { PaymentLinkResponse paymentLinkResponse = (PaymentLinkResponse) o; return Objects.equals(this.allowedPaymentMethods, paymentLinkResponse.allowedPaymentMethods) && Objects.equals(this.amount, paymentLinkResponse.amount) && + Objects.equals(this.applicationInfo, paymentLinkResponse.applicationInfo) && Objects.equals(this.billingAddress, paymentLinkResponse.billingAddress) && Objects.equals(this.blockedPaymentMethods, paymentLinkResponse.blockedPaymentMethods) && Objects.equals(this.captureDelayHours, paymentLinkResponse.captureDelayHours) && @@ -1437,7 +1465,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(allowedPaymentMethods, amount, billingAddress, blockedPaymentMethods, captureDelayHours, countryCode, dateOfBirth, deliverAt, deliveryAddress, description, expiresAt, id, installmentOptions, lineItems, manualCapture, mcc, merchantAccount, merchantOrderReference, metadata, recurringProcessingModel, reference, requiredShopperFields, returnUrl, reusable, riskData, shopperEmail, shopperLocale, shopperName, shopperReference, shopperStatement, showRemovePaymentMethodButton, socialSecurityNumber, splitCardFundingSources, splits, status, store, storePaymentMethodMode, telephoneNumber, themeId, updatedAt, url); + return Objects.hash(allowedPaymentMethods, amount, applicationInfo, billingAddress, blockedPaymentMethods, captureDelayHours, countryCode, dateOfBirth, deliverAt, deliveryAddress, description, expiresAt, id, installmentOptions, lineItems, manualCapture, mcc, merchantAccount, merchantOrderReference, metadata, recurringProcessingModel, reference, requiredShopperFields, returnUrl, reusable, riskData, shopperEmail, shopperLocale, shopperName, shopperReference, shopperStatement, showRemovePaymentMethodButton, socialSecurityNumber, splitCardFundingSources, splits, status, store, storePaymentMethodMode, telephoneNumber, themeId, updatedAt, url); } @Override @@ -1446,6 +1474,7 @@ public String toString() { sb.append("class PaymentLinkResponse {\n"); sb.append(" allowedPaymentMethods: ").append(toIndentedString(allowedPaymentMethods)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" applicationInfo: ").append(toIndentedString(applicationInfo)).append("\n"); sb.append(" billingAddress: ").append(toIndentedString(billingAddress)).append("\n"); sb.append(" blockedPaymentMethods: ").append(toIndentedString(blockedPaymentMethods)).append("\n"); sb.append(" captureDelayHours: ").append(toIndentedString(captureDelayHours)).append("\n"); @@ -1509,6 +1538,7 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("allowedPaymentMethods"); openapiFields.add("amount"); + openapiFields.add("applicationInfo"); openapiFields.add("billingAddress"); openapiFields.add("blockedPaymentMethods"); openapiFields.add("captureDelayHours"); @@ -1596,6 +1626,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.getAsJsonObject("amount") != null) { Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); } + // validate the optional field `applicationInfo` + if (jsonObj.getAsJsonObject("applicationInfo") != null) { + ApplicationInfo.validateJsonObject(jsonObj.getAsJsonObject("applicationInfo")); + } // validate the optional field `billingAddress` if (jsonObj.getAsJsonObject("billingAddress") != null) { Address.validateJsonObject(jsonObj.getAsJsonObject("billingAddress")); diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java b/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java index be75b4b50..67812827f 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java @@ -15,7 +15,7 @@ import java.util.Objects; import java.util.Arrays; import com.adyen.model.checkout.Amount; -import com.adyen.model.checkout.CheckoutOrder; +import com.adyen.model.checkout.EncryptedOrderData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -133,7 +133,7 @@ public ChannelEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_ORDER = "order"; @SerializedName(SERIALIZED_NAME_ORDER) - private CheckoutOrder order; + private EncryptedOrderData order; public static final String SERIALIZED_NAME_SHOPPER_LOCALE = "shopperLocale"; @SerializedName(SERIALIZED_NAME_SHOPPER_LOCALE) @@ -199,10 +199,10 @@ public PaymentMethodsRequest addAllowedPaymentMethodsItem(String allowedPaymentM } /** - * List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` * @return allowedPaymentMethods **/ - @ApiModelProperty(value = "List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`") + @ApiModelProperty(value = "List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`") public List getAllowedPaymentMethods() { return allowedPaymentMethods; @@ -251,10 +251,10 @@ public PaymentMethodsRequest addBlockedPaymentMethodsItem(String blockedPaymentM } /** - * List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` * @return blockedPaymentMethods **/ - @ApiModelProperty(value = "List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`") + @ApiModelProperty(value = "List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`") public List getBlockedPaymentMethods() { return blockedPaymentMethods; @@ -332,7 +332,7 @@ public void setMerchantAccount(String merchantAccount) { } - public PaymentMethodsRequest order(CheckoutOrder order) { + public PaymentMethodsRequest order(EncryptedOrderData order) { this.order = order; return this; @@ -344,12 +344,12 @@ public PaymentMethodsRequest order(CheckoutOrder order) { **/ @ApiModelProperty(value = "") - public CheckoutOrder getOrder() { + public EncryptedOrderData getOrder() { return order; } - public void setOrder(CheckoutOrder order) { + public void setOrder(EncryptedOrderData order) { this.order = order; } @@ -585,7 +585,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field `order` if (jsonObj.getAsJsonObject("order") != null) { - CheckoutOrder.validateJsonObject(jsonObj.getAsJsonObject("order")); + EncryptedOrderData.validateJsonObject(jsonObj.getAsJsonObject("order")); } // validate the optional field shopperLocale if (jsonObj.get("shopperLocale") != null && !jsonObj.get("shopperLocale").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentRefundResource.java b/src/main/java/com/adyen/model/checkout/PaymentRefundResource.java index 99102b34f..a59cae941 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentRefundResource.java +++ b/src/main/java/com/adyen/model/checkout/PaymentRefundResource.java @@ -227,10 +227,10 @@ public PaymentRefundResource addLineItemsItem(LineItem lineItemsItem) { } /** - * Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. * @return lineItems **/ - @ApiModelProperty(value = "Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome.") + @ApiModelProperty(value = "Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.") public List getLineItems() { return lineItems; diff --git a/src/main/java/com/adyen/model/checkout/PaymentRequest.java b/src/main/java/com/adyen/model/checkout/PaymentRequest.java index b138782bf..b98cb3393 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentRequest.java @@ -20,8 +20,8 @@ import com.adyen.model.checkout.ApplicationInfo; import com.adyen.model.checkout.AuthenticationData; import com.adyen.model.checkout.BrowserInfo; -import com.adyen.model.checkout.CheckoutOrder; import com.adyen.model.checkout.Company; +import com.adyen.model.checkout.EncryptedOrderData; import com.adyen.model.checkout.ForexQuote; import com.adyen.model.checkout.Installments; import com.adyen.model.checkout.LineItem; @@ -78,6 +78,10 @@ public class PaymentRequest { @SerializedName(SERIALIZED_NAME_ACCOUNT_INFO) private AccountInfo accountInfo; + public static final String SERIALIZED_NAME_ADDITIONAL_AMOUNT = "additionalAmount"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_AMOUNT) + private Amount additionalAmount; + public static final String SERIALIZED_NAME_ADDITIONAL_DATA = "additionalData"; @SerializedName(SERIALIZED_NAME_ADDITIONAL_DATA) private Map additionalData = null; @@ -357,7 +361,7 @@ public IndustryUsageEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_ORDER = "order"; @SerializedName(SERIALIZED_NAME_ORDER) - private CheckoutOrder order; + private EncryptedOrderData order; public static final String SERIALIZED_NAME_ORDER_REFERENCE = "orderReference"; @SerializedName(SERIALIZED_NAME_ORDER_REFERENCE) @@ -384,7 +388,7 @@ public IndustryUsageEnum read(final JsonReader jsonReader) throws IOException { private String recurringFrequency; /** - * Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. */ @JsonAdapter(RecurringProcessingModelEnum.Adapter.class) public enum RecurringProcessingModelEnum { @@ -596,6 +600,28 @@ public void setAccountInfo(AccountInfo accountInfo) { } + public PaymentRequest additionalAmount(Amount additionalAmount) { + + this.additionalAmount = additionalAmount; + return this; + } + + /** + * Get additionalAmount + * @return additionalAmount + **/ + @ApiModelProperty(value = "") + + public Amount getAdditionalAmount() { + return additionalAmount; + } + + + public void setAdditionalAmount(Amount additionalAmount) { + this.additionalAmount = additionalAmount; + } + + public PaymentRequest additionalData(Map additionalData) { this.additionalData = additionalData; @@ -787,10 +813,10 @@ public PaymentRequest checkoutAttemptId(String checkoutAttemptId) { } /** - * Checkout attempt ID that corresponds to the Id generated for tracking user payment journey. + * Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. * @return checkoutAttemptId **/ - @ApiModelProperty(value = "Checkout attempt ID that corresponds to the Id generated for tracking user payment journey.") + @ApiModelProperty(value = "Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey.") public String getCheckoutAttemptId() { return checkoutAttemptId; @@ -831,10 +857,12 @@ public PaymentRequest conversionId(String conversionId) { } /** - * Conversion ID that corresponds to the Id generated for tracking user payment journey. + * Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. * @return conversionId + * @deprecated **/ - @ApiModelProperty(value = "Conversion ID that corresponds to the Id generated for tracking user payment journey.") + @Deprecated + @ApiModelProperty(value = "Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey.") public String getConversionId() { return conversionId; @@ -1147,10 +1175,10 @@ public PaymentRequest addLineItemsItem(LineItem lineItemsItem) { } /** - * Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. * @return lineItems **/ - @ApiModelProperty(value = "Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome.") + @ApiModelProperty(value = "Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.") public List getLineItems() { return lineItems; @@ -1177,10 +1205,10 @@ public PaymentRequest putLocalizedShopperStatementItem(String key, String locali } /** - * This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. * @return localizedShopperStatement **/ - @ApiModelProperty(value = "This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned.") + @ApiModelProperty(value = "This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions.") public Map getLocalizedShopperStatement() { return localizedShopperStatement; @@ -1354,7 +1382,7 @@ public void setMpiData(ThreeDSecureData mpiData) { } - public PaymentRequest order(CheckoutOrder order) { + public PaymentRequest order(EncryptedOrderData order) { this.order = order; return this; @@ -1366,12 +1394,12 @@ public PaymentRequest order(CheckoutOrder order) { **/ @ApiModelProperty(value = "") - public CheckoutOrder getOrder() { + public EncryptedOrderData getOrder() { return order; } - public void setOrder(CheckoutOrder order) { + public void setOrder(EncryptedOrderData order) { this.order = order; } @@ -1515,10 +1543,10 @@ public PaymentRequest recurringProcessingModel(RecurringProcessingModelEnum recu } /** - * Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. * @return recurringProcessingModel **/ - @ApiModelProperty(value = "Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. ") + @ApiModelProperty(value = "Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. ") public RecurringProcessingModelEnum getRecurringProcessingModel() { return recurringProcessingModel; @@ -2013,6 +2041,7 @@ public boolean equals(Object o) { } PaymentRequest paymentRequest = (PaymentRequest) o; return Objects.equals(this.accountInfo, paymentRequest.accountInfo) && + Objects.equals(this.additionalAmount, paymentRequest.additionalAmount) && Objects.equals(this.additionalData, paymentRequest.additionalData) && Objects.equals(this.amount, paymentRequest.amount) && Objects.equals(this.applicationInfo, paymentRequest.applicationInfo) && @@ -2079,7 +2108,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountInfo, additionalData, amount, applicationInfo, authenticationData, billingAddress, browserInfo, captureDelayHours, channel, checkoutAttemptId, company, conversionId, countryCode, dateOfBirth, dccQuote, deliveryAddress, deliveryDate, deviceFingerprint, enableOneClick, enablePayOut, enableRecurring, entityType, fraudOffset, industryUsage, installments, lineItems, localizedShopperStatement, mandate, mcc, merchantAccount, merchantOrderReference, merchantRiskIndicator, metadata, mpiData, order, orderReference, origin, paymentMethod, platformChargebackLogic, recurringExpiry, recurringFrequency, recurringProcessingModel, redirectFromIssuerMethod, redirectToIssuerMethod, reference, returnUrl, riskData, sessionValidity, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, shopperStatement, socialSecurityNumber, splits, store, storePaymentMethod, telephoneNumber, threeDS2RequestData, threeDSAuthenticationOnly, trustedShopper); + return Objects.hash(accountInfo, additionalAmount, additionalData, amount, applicationInfo, authenticationData, billingAddress, browserInfo, captureDelayHours, channel, checkoutAttemptId, company, conversionId, countryCode, dateOfBirth, dccQuote, deliveryAddress, deliveryDate, deviceFingerprint, enableOneClick, enablePayOut, enableRecurring, entityType, fraudOffset, industryUsage, installments, lineItems, localizedShopperStatement, mandate, mcc, merchantAccount, merchantOrderReference, merchantRiskIndicator, metadata, mpiData, order, orderReference, origin, paymentMethod, platformChargebackLogic, recurringExpiry, recurringFrequency, recurringProcessingModel, redirectFromIssuerMethod, redirectToIssuerMethod, reference, returnUrl, riskData, sessionValidity, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, shopperStatement, socialSecurityNumber, splits, store, storePaymentMethod, telephoneNumber, threeDS2RequestData, threeDSAuthenticationOnly, trustedShopper); } @Override @@ -2087,6 +2116,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PaymentRequest {\n"); sb.append(" accountInfo: ").append(toIndentedString(accountInfo)).append("\n"); + sb.append(" additionalAmount: ").append(toIndentedString(additionalAmount)).append("\n"); sb.append(" additionalData: ").append(toIndentedString(additionalData)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); sb.append(" applicationInfo: ").append(toIndentedString(applicationInfo)).append("\n"); @@ -2172,6 +2202,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("accountInfo"); + openapiFields.add("additionalAmount"); openapiFields.add("additionalData"); openapiFields.add("amount"); openapiFields.add("applicationInfo"); @@ -2277,6 +2308,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.getAsJsonObject("accountInfo") != null) { AccountInfo.validateJsonObject(jsonObj.getAsJsonObject("accountInfo")); } + // validate the optional field `additionalAmount` + if (jsonObj.getAsJsonObject("additionalAmount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("additionalAmount")); + } // validate the optional field `amount` if (jsonObj.getAsJsonObject("amount") != null) { Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); @@ -2388,7 +2423,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field `order` if (jsonObj.getAsJsonObject("order") != null) { - CheckoutOrder.validateJsonObject(jsonObj.getAsJsonObject("order")); + EncryptedOrderData.validateJsonObject(jsonObj.getAsJsonObject("order")); } // validate the optional field orderReference if (jsonObj.get("orderReference") != null && !jsonObj.get("orderReference").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java b/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java index 7f14e12df..408ecb8d4 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java @@ -67,6 +67,10 @@ */ public class PaymentSetupRequest { + public static final String SERIALIZED_NAME_ADDITIONAL_AMOUNT = "additionalAmount"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_AMOUNT) + private Amount additionalAmount; + public static final String SERIALIZED_NAME_ADDITIONAL_DATA = "additionalData"; @SerializedName(SERIALIZED_NAME_ADDITIONAL_DATA) private Map additionalData = null; @@ -437,6 +441,28 @@ public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOExcepti public PaymentSetupRequest() { } + public PaymentSetupRequest additionalAmount(Amount additionalAmount) { + + this.additionalAmount = additionalAmount; + return this; + } + + /** + * Get additionalAmount + * @return additionalAmount + **/ + @ApiModelProperty(value = "") + + public Amount getAdditionalAmount() { + return additionalAmount; + } + + + public void setAdditionalAmount(Amount additionalAmount) { + this.additionalAmount = additionalAmount; + } + + public PaymentSetupRequest additionalData(Map additionalData) { this.additionalData = additionalData; @@ -482,10 +508,10 @@ public PaymentSetupRequest addAllowedPaymentMethodsItem(String allowedPaymentMet } /** - * List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + * List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` * @return allowedPaymentMethods **/ - @ApiModelProperty(value = "List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`") + @ApiModelProperty(value = "List of payment methods to be presented to the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`") public List getAllowedPaymentMethods() { return allowedPaymentMethods; @@ -578,10 +604,10 @@ public PaymentSetupRequest addBlockedPaymentMethodsItem(String blockedPaymentMet } /** - * List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + * List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` * @return blockedPaymentMethods **/ - @ApiModelProperty(value = "List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`") + @ApiModelProperty(value = "List of payment methods to be hidden from the shopper. To refer to payment methods, use their [payment method type](https://docs.adyen.com/payment-methods/payment-method-types). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`") public List getBlockedPaymentMethods() { return blockedPaymentMethods; @@ -644,10 +670,10 @@ public PaymentSetupRequest checkoutAttemptId(String checkoutAttemptId) { } /** - * Checkout attempt ID that corresponds to the Id generated for tracking user payment journey. + * Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey. * @return checkoutAttemptId **/ - @ApiModelProperty(value = "Checkout attempt ID that corresponds to the Id generated for tracking user payment journey.") + @ApiModelProperty(value = "Checkout attempt ID that corresponds to the Id generated by the client SDK for tracking user payment journey.") public String getCheckoutAttemptId() { return checkoutAttemptId; @@ -710,10 +736,12 @@ public PaymentSetupRequest conversionId(String conversionId) { } /** - * Conversion ID that corresponds to the Id generated for tracking user payment journey. + * Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey. * @return conversionId + * @deprecated **/ - @ApiModelProperty(value = "Conversion ID that corresponds to the Id generated for tracking user payment journey.") + @Deprecated + @ApiModelProperty(value = "Conversion ID that corresponds to the Id generated by the client SDK for tracking user payment journey.") public String getConversionId() { return conversionId; @@ -982,10 +1010,10 @@ public PaymentSetupRequest addLineItemsItem(LineItem lineItemsItem) { } /** - * Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome. + * Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip. * @return lineItems **/ - @ApiModelProperty(value = "Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, Zip and Atome.") + @ApiModelProperty(value = "Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.") public List getLineItems() { return lineItems; @@ -1012,10 +1040,10 @@ public PaymentSetupRequest putLocalizedShopperStatementItem(String key, String l } /** - * This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. * @return localizedShopperStatement **/ - @ApiModelProperty(value = "This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned.") + @ApiModelProperty(value = "This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions.") public Map getLocalizedShopperStatement() { return localizedShopperStatement; @@ -1715,7 +1743,8 @@ public boolean equals(Object o) { return false; } PaymentSetupRequest paymentSetupRequest = (PaymentSetupRequest) o; - return Objects.equals(this.additionalData, paymentSetupRequest.additionalData) && + return Objects.equals(this.additionalAmount, paymentSetupRequest.additionalAmount) && + Objects.equals(this.additionalData, paymentSetupRequest.additionalData) && Objects.equals(this.allowedPaymentMethods, paymentSetupRequest.allowedPaymentMethods) && Objects.equals(this.amount, paymentSetupRequest.amount) && Objects.equals(this.applicationInfo, paymentSetupRequest.applicationInfo) && @@ -1774,13 +1803,14 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(additionalData, allowedPaymentMethods, amount, applicationInfo, billingAddress, blockedPaymentMethods, captureDelayHours, channel, checkoutAttemptId, company, configuration, conversionId, countryCode, dateOfBirth, dccQuote, deliveryAddress, deliveryDate, enableOneClick, enablePayOut, enableRecurring, entityType, fraudOffset, installments, lineItems, localizedShopperStatement, mandate, mcc, merchantAccount, merchantOrderReference, metadata, orderReference, origin, platformChargebackLogic, recurringExpiry, recurringFrequency, reference, returnUrl, riskData, sdkVersion, sessionValidity, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, shopperStatement, socialSecurityNumber, splits, store, storePaymentMethod, telephoneNumber, threeDSAuthenticationOnly, token, trustedShopper); + return Objects.hash(additionalAmount, additionalData, allowedPaymentMethods, amount, applicationInfo, billingAddress, blockedPaymentMethods, captureDelayHours, channel, checkoutAttemptId, company, configuration, conversionId, countryCode, dateOfBirth, dccQuote, deliveryAddress, deliveryDate, enableOneClick, enablePayOut, enableRecurring, entityType, fraudOffset, installments, lineItems, localizedShopperStatement, mandate, mcc, merchantAccount, merchantOrderReference, metadata, orderReference, origin, platformChargebackLogic, recurringExpiry, recurringFrequency, reference, returnUrl, riskData, sdkVersion, sessionValidity, shopperEmail, shopperIP, shopperInteraction, shopperLocale, shopperName, shopperReference, shopperStatement, socialSecurityNumber, splits, store, storePaymentMethod, telephoneNumber, threeDSAuthenticationOnly, token, trustedShopper); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PaymentSetupRequest {\n"); + sb.append(" additionalAmount: ").append(toIndentedString(additionalAmount)).append("\n"); sb.append(" additionalData: ").append(toIndentedString(additionalData)).append("\n"); sb.append(" allowedPaymentMethods: ").append(toIndentedString(allowedPaymentMethods)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); @@ -1858,6 +1888,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("additionalAmount"); openapiFields.add("additionalData"); openapiFields.add("allowedPaymentMethods"); openapiFields.add("amount"); @@ -1952,6 +1983,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); } } + // validate the optional field `additionalAmount` + if (jsonObj.getAsJsonObject("additionalAmount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("additionalAmount")); + } // ensure the json data is an array if (jsonObj.get("allowedPaymentMethods") != null && !jsonObj.get("allowedPaymentMethods").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `allowedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("allowedPaymentMethods").toString())); diff --git a/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java b/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java index e5799d86c..f83691b0b 100644 --- a/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java +++ b/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java @@ -101,6 +101,10 @@ public BehaviorEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_BEHAVIOR) private BehaviorEnum behavior; + public static final String SERIALIZED_NAME_COST_ALLOCATION_ACCOUNT = "costAllocationAccount"; + @SerializedName(SERIALIZED_NAME_COST_ALLOCATION_ACCOUNT) + private String costAllocationAccount; + public static final String SERIALIZED_NAME_TARGET_ACCOUNT = "targetAccount"; @SerializedName(SERIALIZED_NAME_TARGET_ACCOUNT) private String targetAccount; @@ -130,6 +134,28 @@ public void setBehavior(BehaviorEnum behavior) { } + public PlatformChargebackLogic costAllocationAccount(String costAllocationAccount) { + + this.costAllocationAccount = costAllocationAccount; + return this; + } + + /** + * Get costAllocationAccount + * @return costAllocationAccount + **/ + @ApiModelProperty(value = "") + + public String getCostAllocationAccount() { + return costAllocationAccount; + } + + + public void setCostAllocationAccount(String costAllocationAccount) { + this.costAllocationAccount = costAllocationAccount; + } + + public PlatformChargebackLogic targetAccount(String targetAccount) { this.targetAccount = targetAccount; @@ -163,12 +189,13 @@ public boolean equals(Object o) { } PlatformChargebackLogic platformChargebackLogic = (PlatformChargebackLogic) o; return Objects.equals(this.behavior, platformChargebackLogic.behavior) && + Objects.equals(this.costAllocationAccount, platformChargebackLogic.costAllocationAccount) && Objects.equals(this.targetAccount, platformChargebackLogic.targetAccount); } @Override public int hashCode() { - return Objects.hash(behavior, targetAccount); + return Objects.hash(behavior, costAllocationAccount, targetAccount); } @Override @@ -176,6 +203,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PlatformChargebackLogic {\n"); sb.append(" behavior: ").append(toIndentedString(behavior)).append("\n"); + sb.append(" costAllocationAccount: ").append(toIndentedString(costAllocationAccount)).append("\n"); sb.append(" targetAccount: ").append(toIndentedString(targetAccount)).append("\n"); sb.append("}"); return sb.toString(); @@ -200,6 +228,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("behavior"); + openapiFields.add("costAllocationAccount"); openapiFields.add("targetAccount"); // a set of required properties/fields (JSON key names) @@ -235,6 +264,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } BehaviorEnum.fromValue(jsonObj.get("behavior").getAsString()); } + // validate the optional field costAllocationAccount + if (jsonObj.get("costAllocationAccount") != null && !jsonObj.get("costAllocationAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `costAllocationAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("costAllocationAccount").toString())); + } // validate the optional field targetAccount if (jsonObj.get("targetAccount") != null && !jsonObj.get("targetAccount").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `targetAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("targetAccount").toString())); diff --git a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java index 63386ccf2..af3720d32 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java @@ -75,6 +75,8 @@ public enum TypeEnum { MOMO_WALLET_APP("momo_wallet_app"), + TWINT("twint"), + PAYMAYA_WALLET("paymaya_wallet"), GRABPAY_SG("grabpay_SG"), @@ -95,7 +97,9 @@ public enum TypeEnum { KAKAOPAY("kakaopay"), - TRUEMONEY("truemoney"); + TRUEMONEY("truemoney"), + + TWINT_POS("twint_pos"); private String value; diff --git a/src/main/java/com/adyen/service/checkout/ClassicCheckoutSdkApi.java b/src/main/java/com/adyen/service/checkout/ClassicCheckoutSdkApi.java new file mode 100644 index 000000000..102060e21 --- /dev/null +++ b/src/main/java/com/adyen/service/checkout/ClassicCheckoutSdkApi.java @@ -0,0 +1,99 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.checkout; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.checkout.PaymentSetupRequest; +import com.adyen.model.checkout.PaymentSetupResponse; +import com.adyen.model.checkout.PaymentVerificationRequest; +import com.adyen.model.checkout.PaymentVerificationResponse; +import com.adyen.model.checkout.ServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class ClassicCheckoutSdkApi extends Service { + private final String baseURL; + + public ClassicCheckoutSdkApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://checkout-test.adyen.com/v70"); + } + + /** + * Create a payment session + * + * @param paymentSetupRequest {@link PaymentSetupRequest } (required) + * @return {@link PaymentSetupResponse } + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public PaymentSetupResponse paymentSession(PaymentSetupRequest paymentSetupRequest) throws ApiException, IOException { + return paymentSession(paymentSetupRequest, null); + } + + /** + * Create a payment session + * + * @param paymentSetupRequest {@link PaymentSetupRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentSetupResponse } + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public PaymentSetupResponse paymentSession(PaymentSetupRequest paymentSetupRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = paymentSetupRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/paymentSession", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return PaymentSetupResponse.fromJson(jsonResult); + } + + /** + * Verify a payment result + * + * @param paymentVerificationRequest {@link PaymentVerificationRequest } (required) + * @return {@link PaymentVerificationResponse } + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public PaymentVerificationResponse verifyPaymentResult(PaymentVerificationRequest paymentVerificationRequest) throws ApiException, IOException { + return verifyPaymentResult(paymentVerificationRequest, null); + } + + /** + * Verify a payment result + * + * @param paymentVerificationRequest {@link PaymentVerificationRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentVerificationResponse } + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public PaymentVerificationResponse verifyPaymentResult(PaymentVerificationRequest paymentVerificationRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = paymentVerificationRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/payments/result", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return PaymentVerificationResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/checkout/ModificationsApi.java b/src/main/java/com/adyen/service/checkout/ModificationsApi.java new file mode 100644 index 000000000..18dc1273e --- /dev/null +++ b/src/main/java/com/adyen/service/checkout/ModificationsApi.java @@ -0,0 +1,247 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.checkout; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.checkout.CreatePaymentAmountUpdateRequest; +import com.adyen.model.checkout.CreatePaymentCancelRequest; +import com.adyen.model.checkout.CreatePaymentCaptureRequest; +import com.adyen.model.checkout.CreatePaymentRefundRequest; +import com.adyen.model.checkout.CreatePaymentReversalRequest; +import com.adyen.model.checkout.CreateStandalonePaymentCancelRequest; +import com.adyen.model.checkout.PaymentAmountUpdateResource; +import com.adyen.model.checkout.PaymentCancelResource; +import com.adyen.model.checkout.PaymentCaptureResource; +import com.adyen.model.checkout.PaymentRefundResource; +import com.adyen.model.checkout.PaymentReversalResource; +import com.adyen.model.checkout.ServiceError; +import com.adyen.model.checkout.StandalonePaymentCancelResource; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class ModificationsApi extends Service { + private final String baseURL; + + public ModificationsApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://checkout-test.adyen.com/v70"); + } + + /** + * Cancel an authorised payment + * + * @param createStandalonePaymentCancelRequest {@link CreateStandalonePaymentCancelRequest } (required) + * @return {@link StandalonePaymentCancelResource } + * @throws ApiException if fails to make API call + */ + public StandalonePaymentCancelResource cancelAuthorisedPayment(CreateStandalonePaymentCancelRequest createStandalonePaymentCancelRequest) throws ApiException, IOException { + return cancelAuthorisedPayment(createStandalonePaymentCancelRequest, null); + } + + /** + * Cancel an authorised payment + * + * @param createStandalonePaymentCancelRequest {@link CreateStandalonePaymentCancelRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link StandalonePaymentCancelResource } + * @throws ApiException if fails to make API call + */ + public StandalonePaymentCancelResource cancelAuthorisedPayment(CreateStandalonePaymentCancelRequest createStandalonePaymentCancelRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = createStandalonePaymentCancelRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/cancels", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return StandalonePaymentCancelResource.fromJson(jsonResult); + } + + /** + * Update an authorised amount + * + * @param paymentPspReference {@link String } The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. (required) + * @param createPaymentAmountUpdateRequest {@link CreatePaymentAmountUpdateRequest } (required) + * @return {@link PaymentAmountUpdateResource } + * @throws ApiException if fails to make API call + */ + public PaymentAmountUpdateResource updateAuthorisedAmount(String paymentPspReference, CreatePaymentAmountUpdateRequest createPaymentAmountUpdateRequest) throws ApiException, IOException { + return updateAuthorisedAmount(paymentPspReference, createPaymentAmountUpdateRequest, null); + } + + /** + * Update an authorised amount + * + * @param paymentPspReference {@link String } The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment. (required) + * @param createPaymentAmountUpdateRequest {@link CreatePaymentAmountUpdateRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentAmountUpdateResource } + * @throws ApiException if fails to make API call + */ + public PaymentAmountUpdateResource updateAuthorisedAmount(String paymentPspReference, CreatePaymentAmountUpdateRequest createPaymentAmountUpdateRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (paymentPspReference == null) { + throw new IllegalArgumentException("Please provide the paymentPspReference path parameter"); + } + pathParams.put("paymentPspReference", paymentPspReference); + + String requestBody = createPaymentAmountUpdateRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/payments/{paymentPspReference}/amountUpdates", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return PaymentAmountUpdateResource.fromJson(jsonResult); + } + + /** + * Cancel an authorised payment + * + * @param paymentPspReference {@link String } The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. (required) + * @param createPaymentCancelRequest {@link CreatePaymentCancelRequest } (required) + * @return {@link PaymentCancelResource } + * @throws ApiException if fails to make API call + */ + public PaymentCancelResource cancelAuthorisedPaymentByPspReference(String paymentPspReference, CreatePaymentCancelRequest createPaymentCancelRequest) throws ApiException, IOException { + return cancelAuthorisedPaymentByPspReference(paymentPspReference, createPaymentCancelRequest, null); + } + + /** + * Cancel an authorised payment + * + * @param paymentPspReference {@link String } The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel. (required) + * @param createPaymentCancelRequest {@link CreatePaymentCancelRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentCancelResource } + * @throws ApiException if fails to make API call + */ + public PaymentCancelResource cancelAuthorisedPaymentByPspReference(String paymentPspReference, CreatePaymentCancelRequest createPaymentCancelRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (paymentPspReference == null) { + throw new IllegalArgumentException("Please provide the paymentPspReference path parameter"); + } + pathParams.put("paymentPspReference", paymentPspReference); + + String requestBody = createPaymentCancelRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/payments/{paymentPspReference}/cancels", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return PaymentCancelResource.fromJson(jsonResult); + } + + /** + * Capture an authorised payment + * + * @param paymentPspReference {@link String } The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. (required) + * @param createPaymentCaptureRequest {@link CreatePaymentCaptureRequest } (required) + * @return {@link PaymentCaptureResource } + * @throws ApiException if fails to make API call + */ + public PaymentCaptureResource captureAuthorisedPayment(String paymentPspReference, CreatePaymentCaptureRequest createPaymentCaptureRequest) throws ApiException, IOException { + return captureAuthorisedPayment(paymentPspReference, createPaymentCaptureRequest, null); + } + + /** + * Capture an authorised payment + * + * @param paymentPspReference {@link String } The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture. (required) + * @param createPaymentCaptureRequest {@link CreatePaymentCaptureRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentCaptureResource } + * @throws ApiException if fails to make API call + */ + public PaymentCaptureResource captureAuthorisedPayment(String paymentPspReference, CreatePaymentCaptureRequest createPaymentCaptureRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (paymentPspReference == null) { + throw new IllegalArgumentException("Please provide the paymentPspReference path parameter"); + } + pathParams.put("paymentPspReference", paymentPspReference); + + String requestBody = createPaymentCaptureRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/payments/{paymentPspReference}/captures", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return PaymentCaptureResource.fromJson(jsonResult); + } + + /** + * Refund a captured payment + * + * @param paymentPspReference {@link String } The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. (required) + * @param createPaymentRefundRequest {@link CreatePaymentRefundRequest } (required) + * @return {@link PaymentRefundResource } + * @throws ApiException if fails to make API call + */ + public PaymentRefundResource refundCapturedPayment(String paymentPspReference, CreatePaymentRefundRequest createPaymentRefundRequest) throws ApiException, IOException { + return refundCapturedPayment(paymentPspReference, createPaymentRefundRequest, null); + } + + /** + * Refund a captured payment + * + * @param paymentPspReference {@link String } The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund. (required) + * @param createPaymentRefundRequest {@link CreatePaymentRefundRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentRefundResource } + * @throws ApiException if fails to make API call + */ + public PaymentRefundResource refundCapturedPayment(String paymentPspReference, CreatePaymentRefundRequest createPaymentRefundRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (paymentPspReference == null) { + throw new IllegalArgumentException("Please provide the paymentPspReference path parameter"); + } + pathParams.put("paymentPspReference", paymentPspReference); + + String requestBody = createPaymentRefundRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/payments/{paymentPspReference}/refunds", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return PaymentRefundResource.fromJson(jsonResult); + } + + /** + * Refund or cancel a payment + * + * @param paymentPspReference {@link String } The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. (required) + * @param createPaymentReversalRequest {@link CreatePaymentReversalRequest } (required) + * @return {@link PaymentReversalResource } + * @throws ApiException if fails to make API call + */ + public PaymentReversalResource refundOrCancelPayment(String paymentPspReference, CreatePaymentReversalRequest createPaymentReversalRequest) throws ApiException, IOException { + return refundOrCancelPayment(paymentPspReference, createPaymentReversalRequest, null); + } + + /** + * Refund or cancel a payment + * + * @param paymentPspReference {@link String } The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse. (required) + * @param createPaymentReversalRequest {@link CreatePaymentReversalRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentReversalResource } + * @throws ApiException if fails to make API call + */ + public PaymentReversalResource refundOrCancelPayment(String paymentPspReference, CreatePaymentReversalRequest createPaymentReversalRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (paymentPspReference == null) { + throw new IllegalArgumentException("Please provide the paymentPspReference path parameter"); + } + pathParams.put("paymentPspReference", paymentPspReference); + + String requestBody = createPaymentReversalRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/payments/{paymentPspReference}/reversals", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return PaymentReversalResource.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/checkout/OrdersApi.java b/src/main/java/com/adyen/service/checkout/OrdersApi.java new file mode 100644 index 000000000..17af49974 --- /dev/null +++ b/src/main/java/com/adyen/service/checkout/OrdersApi.java @@ -0,0 +1,120 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.checkout; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.checkout.CheckoutBalanceCheckRequest; +import com.adyen.model.checkout.CheckoutBalanceCheckResponse; +import com.adyen.model.checkout.CheckoutCancelOrderRequest; +import com.adyen.model.checkout.CheckoutCancelOrderResponse; +import com.adyen.model.checkout.CheckoutCreateOrderRequest; +import com.adyen.model.checkout.CheckoutCreateOrderResponse; +import com.adyen.model.checkout.ServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class OrdersApi extends Service { + private final String baseURL; + + public OrdersApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://checkout-test.adyen.com/v70"); + } + + /** + * Create an order + * + * @param checkoutCreateOrderRequest {@link CheckoutCreateOrderRequest } (required) + * @return {@link CheckoutCreateOrderResponse } + * @throws ApiException if fails to make API call + */ + public CheckoutCreateOrderResponse orders(CheckoutCreateOrderRequest checkoutCreateOrderRequest) throws ApiException, IOException { + return orders(checkoutCreateOrderRequest, null); + } + + /** + * Create an order + * + * @param checkoutCreateOrderRequest {@link CheckoutCreateOrderRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CheckoutCreateOrderResponse } + * @throws ApiException if fails to make API call + */ + public CheckoutCreateOrderResponse orders(CheckoutCreateOrderRequest checkoutCreateOrderRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = checkoutCreateOrderRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/orders", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return CheckoutCreateOrderResponse.fromJson(jsonResult); + } + + /** + * Cancel an order + * + * @param checkoutCancelOrderRequest {@link CheckoutCancelOrderRequest } (required) + * @return {@link CheckoutCancelOrderResponse } + * @throws ApiException if fails to make API call + */ + public CheckoutCancelOrderResponse cancelOrder(CheckoutCancelOrderRequest checkoutCancelOrderRequest) throws ApiException, IOException { + return cancelOrder(checkoutCancelOrderRequest, null); + } + + /** + * Cancel an order + * + * @param checkoutCancelOrderRequest {@link CheckoutCancelOrderRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CheckoutCancelOrderResponse } + * @throws ApiException if fails to make API call + */ + public CheckoutCancelOrderResponse cancelOrder(CheckoutCancelOrderRequest checkoutCancelOrderRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = checkoutCancelOrderRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/orders/cancel", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return CheckoutCancelOrderResponse.fromJson(jsonResult); + } + + /** + * Get the balance of a gift card + * + * @param checkoutBalanceCheckRequest {@link CheckoutBalanceCheckRequest } (required) + * @return {@link CheckoutBalanceCheckResponse } + * @throws ApiException if fails to make API call + */ + public CheckoutBalanceCheckResponse getBalanceOfGiftCard(CheckoutBalanceCheckRequest checkoutBalanceCheckRequest) throws ApiException, IOException { + return getBalanceOfGiftCard(checkoutBalanceCheckRequest, null); + } + + /** + * Get the balance of a gift card + * + * @param checkoutBalanceCheckRequest {@link CheckoutBalanceCheckRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CheckoutBalanceCheckResponse } + * @throws ApiException if fails to make API call + */ + public CheckoutBalanceCheckResponse getBalanceOfGiftCard(CheckoutBalanceCheckRequest checkoutBalanceCheckRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = checkoutBalanceCheckRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/paymentMethods/balance", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return CheckoutBalanceCheckResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/checkout/PaymentLinksApi.java b/src/main/java/com/adyen/service/checkout/PaymentLinksApi.java new file mode 100644 index 000000000..a8fd29b4f --- /dev/null +++ b/src/main/java/com/adyen/service/checkout/PaymentLinksApi.java @@ -0,0 +1,131 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.checkout; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.checkout.CreatePaymentLinkRequest; +import com.adyen.model.checkout.PaymentLinkResponse; +import com.adyen.model.checkout.ServiceError; +import com.adyen.model.checkout.UpdatePaymentLinkRequest; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class PaymentLinksApi extends Service { + private final String baseURL; + + public PaymentLinksApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://checkout-test.adyen.com/v70"); + } + + /** + * Get a payment link + * + * @param linkId {@link String } Unique identifier of the payment link. (required) + * @return {@link PaymentLinkResponse } + * @throws ApiException if fails to make API call + */ + public PaymentLinkResponse getPaymentLink(String linkId) throws ApiException, IOException { + return getPaymentLink(linkId, null); + } + + /** + * Get a payment link + * + * @param linkId {@link String } Unique identifier of the payment link. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentLinkResponse } + * @throws ApiException if fails to make API call + */ + public PaymentLinkResponse getPaymentLink(String linkId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (linkId == null) { + throw new IllegalArgumentException("Please provide the linkId path parameter"); + } + pathParams.put("linkId", linkId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/paymentLinks/{linkId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return PaymentLinkResponse.fromJson(jsonResult); + } + + /** + * Update the status of a payment link + * + * @param linkId {@link String } Unique identifier of the payment link. (required) + * @param updatePaymentLinkRequest {@link UpdatePaymentLinkRequest } (required) + * @return {@link PaymentLinkResponse } + * @throws ApiException if fails to make API call + */ + public PaymentLinkResponse updatePaymentLink(String linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest) throws ApiException, IOException { + return updatePaymentLink(linkId, updatePaymentLinkRequest, null); + } + + /** + * Update the status of a payment link + * + * @param linkId {@link String } Unique identifier of the payment link. (required) + * @param updatePaymentLinkRequest {@link UpdatePaymentLinkRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentLinkResponse } + * @throws ApiException if fails to make API call + */ + public PaymentLinkResponse updatePaymentLink(String linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (linkId == null) { + throw new IllegalArgumentException("Please provide the linkId path parameter"); + } + pathParams.put("linkId", linkId); + + String requestBody = updatePaymentLinkRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/paymentLinks/{linkId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return PaymentLinkResponse.fromJson(jsonResult); + } + + /** + * Create a payment link + * + * @param createPaymentLinkRequest {@link CreatePaymentLinkRequest } (required) + * @return {@link PaymentLinkResponse } + * @throws ApiException if fails to make API call + */ + public PaymentLinkResponse paymentLinks(CreatePaymentLinkRequest createPaymentLinkRequest) throws ApiException, IOException { + return paymentLinks(createPaymentLinkRequest, null); + } + + /** + * Create a payment link + * + * @param createPaymentLinkRequest {@link CreatePaymentLinkRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentLinkResponse } + * @throws ApiException if fails to make API call + */ + public PaymentLinkResponse paymentLinks(CreatePaymentLinkRequest createPaymentLinkRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = createPaymentLinkRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/paymentLinks", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return PaymentLinkResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/checkout/PaymentsApi.java b/src/main/java/com/adyen/service/checkout/PaymentsApi.java new file mode 100644 index 000000000..aa80a4033 --- /dev/null +++ b/src/main/java/com/adyen/service/checkout/PaymentsApi.java @@ -0,0 +1,207 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.checkout; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.checkout.CardDetailsRequest; +import com.adyen.model.checkout.CardDetailsResponse; +import com.adyen.model.checkout.CreateCheckoutSessionRequest; +import com.adyen.model.checkout.CreateCheckoutSessionResponse; +import com.adyen.model.checkout.DetailsRequest; +import com.adyen.model.checkout.DonationResponse; +import com.adyen.model.checkout.PaymentDetailsResponse; +import com.adyen.model.checkout.PaymentDonationRequest; +import com.adyen.model.checkout.PaymentMethodsRequest; +import com.adyen.model.checkout.PaymentMethodsResponse; +import com.adyen.model.checkout.PaymentRequest; +import com.adyen.model.checkout.PaymentResponse; +import com.adyen.model.checkout.ServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class PaymentsApi extends Service { + private final String baseURL; + + public PaymentsApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://checkout-test.adyen.com/v70"); + } + + /** + * Get the list of brands on the card + * + * @param cardDetailsRequest {@link CardDetailsRequest } (required) + * @return {@link CardDetailsResponse } + * @throws ApiException if fails to make API call + */ + public CardDetailsResponse cardDetails(CardDetailsRequest cardDetailsRequest) throws ApiException, IOException { + return cardDetails(cardDetailsRequest, null); + } + + /** + * Get the list of brands on the card + * + * @param cardDetailsRequest {@link CardDetailsRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CardDetailsResponse } + * @throws ApiException if fails to make API call + */ + public CardDetailsResponse cardDetails(CardDetailsRequest cardDetailsRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = cardDetailsRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/cardDetails", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return CardDetailsResponse.fromJson(jsonResult); + } + + /** + * Start a transaction for donations + * + * @param paymentDonationRequest {@link PaymentDonationRequest } (required) + * @return {@link DonationResponse } + * @throws ApiException if fails to make API call + */ + public DonationResponse donations(PaymentDonationRequest paymentDonationRequest) throws ApiException, IOException { + return donations(paymentDonationRequest, null); + } + + /** + * Start a transaction for donations + * + * @param paymentDonationRequest {@link PaymentDonationRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link DonationResponse } + * @throws ApiException if fails to make API call + */ + public DonationResponse donations(PaymentDonationRequest paymentDonationRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = paymentDonationRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/donations", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return DonationResponse.fromJson(jsonResult); + } + + /** + * Get a list of available payment methods + * + * @param paymentMethodsRequest {@link PaymentMethodsRequest } (required) + * @return {@link PaymentMethodsResponse } + * @throws ApiException if fails to make API call + */ + public PaymentMethodsResponse paymentMethods(PaymentMethodsRequest paymentMethodsRequest) throws ApiException, IOException { + return paymentMethods(paymentMethodsRequest, null); + } + + /** + * Get a list of available payment methods + * + * @param paymentMethodsRequest {@link PaymentMethodsRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentMethodsResponse } + * @throws ApiException if fails to make API call + */ + public PaymentMethodsResponse paymentMethods(PaymentMethodsRequest paymentMethodsRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = paymentMethodsRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/paymentMethods", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return PaymentMethodsResponse.fromJson(jsonResult); + } + + /** + * Start a transaction + * + * @param paymentRequest {@link PaymentRequest } (required) + * @return {@link PaymentResponse } + * @throws ApiException if fails to make API call + */ + public PaymentResponse payments(PaymentRequest paymentRequest) throws ApiException, IOException { + return payments(paymentRequest, null); + } + + /** + * Start a transaction + * + * @param paymentRequest {@link PaymentRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentResponse } + * @throws ApiException if fails to make API call + */ + public PaymentResponse payments(PaymentRequest paymentRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = paymentRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/payments", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return PaymentResponse.fromJson(jsonResult); + } + + /** + * Submit details for a payment + * + * @param detailsRequest {@link DetailsRequest } (required) + * @return {@link PaymentDetailsResponse } + * @throws ApiException if fails to make API call + */ + public PaymentDetailsResponse paymentsDetails(DetailsRequest detailsRequest) throws ApiException, IOException { + return paymentsDetails(detailsRequest, null); + } + + /** + * Submit details for a payment + * + * @param detailsRequest {@link DetailsRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentDetailsResponse } + * @throws ApiException if fails to make API call + */ + public PaymentDetailsResponse paymentsDetails(DetailsRequest detailsRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = detailsRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/payments/details", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return PaymentDetailsResponse.fromJson(jsonResult); + } + + /** + * Create a payment session + * + * @param createCheckoutSessionRequest {@link CreateCheckoutSessionRequest } (required) + * @return {@link CreateCheckoutSessionResponse } + * @throws ApiException if fails to make API call + */ + public CreateCheckoutSessionResponse sessions(CreateCheckoutSessionRequest createCheckoutSessionRequest) throws ApiException, IOException { + return sessions(createCheckoutSessionRequest, null); + } + + /** + * Create a payment session + * + * @param createCheckoutSessionRequest {@link CreateCheckoutSessionRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CreateCheckoutSessionResponse } + * @throws ApiException if fails to make API call + */ + public CreateCheckoutSessionResponse sessions(CreateCheckoutSessionRequest createCheckoutSessionRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = createCheckoutSessionRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/sessions", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return CreateCheckoutSessionResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/checkout/RecurringApi.java b/src/main/java/com/adyen/service/checkout/RecurringApi.java new file mode 100644 index 000000000..4ea979ba8 --- /dev/null +++ b/src/main/java/com/adyen/service/checkout/RecurringApi.java @@ -0,0 +1,114 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.checkout; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.checkout.ListStoredPaymentMethodsResponse; +import com.adyen.model.checkout.StoredPaymentMethodResource; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class RecurringApi extends Service { + private final String baseURL; + + public RecurringApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://checkout-test.adyen.com/v70"); + } + + /** + * Delete a token for stored payment details + * + * @param recurringId {@link String } The unique identifier of the token. (required) + * @param shopperReference {@link String } Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. (required) + * @param merchantAccount {@link String } Your merchant account. (required) + * @return {@link StoredPaymentMethodResource } + * @throws ApiException if fails to make API call + */ + public StoredPaymentMethodResource deleteTokenForStoredPaymentDetails(String recurringId, String shopperReference, String merchantAccount) throws ApiException, IOException { + return deleteTokenForStoredPaymentDetails(recurringId, shopperReference, merchantAccount, null); + } + + /** + * Delete a token for stored payment details + * + * @param recurringId {@link String } The unique identifier of the token. (required) + * @param shopperReference {@link String } Query: Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. (required) + * @param merchantAccount {@link String } Query: Your merchant account. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link StoredPaymentMethodResource } + * @throws ApiException if fails to make API call + */ + public StoredPaymentMethodResource deleteTokenForStoredPaymentDetails(String recurringId, String shopperReference, String merchantAccount, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (recurringId == null) { + throw new IllegalArgumentException("Please provide the recurringId path parameter"); + } + pathParams.put("recurringId", recurringId); + //Add query params + Map queryParams = new HashMap<>(); + if (shopperReference != null) { + queryParams.put("shopperReference", shopperReference); + } + if (merchantAccount != null) { + queryParams.put("merchantAccount", merchantAccount); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/storedPaymentMethods/{recurringId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.DELETE, pathParams, queryParams); + return StoredPaymentMethodResource.fromJson(jsonResult); + } + + /** + * Get tokens for stored payment details + * + * @return {@link ListStoredPaymentMethodsResponse } + * @throws ApiException if fails to make API call + */ + public ListStoredPaymentMethodsResponse getTokensForStoredPaymentDetails() throws ApiException, IOException { + return getTokensForStoredPaymentDetails(null, null, null); + } + + /** + * Get tokens for stored payment details + * + * @param shopperReference {@link String } Query: Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. (optional) + * @param merchantAccount {@link String } Query: Your merchant account. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ListStoredPaymentMethodsResponse } + * @throws ApiException if fails to make API call + */ + public ListStoredPaymentMethodsResponse getTokensForStoredPaymentDetails(String shopperReference, String merchantAccount, RequestOptions requestOptions) throws ApiException, IOException { + //Add query params + Map queryParams = new HashMap<>(); + if (shopperReference != null) { + queryParams.put("shopperReference", shopperReference); + } + if (merchantAccount != null) { + queryParams.put("merchantAccount", merchantAccount); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/storedPaymentMethods", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, null, queryParams); + return ListStoredPaymentMethodsResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/checkout/UtilityApi.java b/src/main/java/com/adyen/service/checkout/UtilityApi.java new file mode 100644 index 000000000..fc8065d60 --- /dev/null +++ b/src/main/java/com/adyen/service/checkout/UtilityApi.java @@ -0,0 +1,95 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 70 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.checkout; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.checkout.ApplePaySessionResponse; +import com.adyen.model.checkout.CheckoutUtilityRequest; +import com.adyen.model.checkout.CheckoutUtilityResponse; +import com.adyen.model.checkout.CreateApplePaySessionRequest; +import com.adyen.model.checkout.ServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class UtilityApi extends Service { + private final String baseURL; + + public UtilityApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://checkout-test.adyen.com/v70"); + } + + /** + * Get an Apple Pay session + * + * @param createApplePaySessionRequest {@link CreateApplePaySessionRequest } (required) + * @return {@link ApplePaySessionResponse } + * @throws ApiException if fails to make API call + */ + public ApplePaySessionResponse getApplePaySession(CreateApplePaySessionRequest createApplePaySessionRequest) throws ApiException, IOException { + return getApplePaySession(createApplePaySessionRequest, null); + } + + /** + * Get an Apple Pay session + * + * @param createApplePaySessionRequest {@link CreateApplePaySessionRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ApplePaySessionResponse } + * @throws ApiException if fails to make API call + */ + public ApplePaySessionResponse getApplePaySession(CreateApplePaySessionRequest createApplePaySessionRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = createApplePaySessionRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/applePay/sessions", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return ApplePaySessionResponse.fromJson(jsonResult); + } + + /** + * Create originKey values for domains + * + * @param checkoutUtilityRequest {@link CheckoutUtilityRequest } (required) + * @return {@link CheckoutUtilityResponse } + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public CheckoutUtilityResponse originKeys(CheckoutUtilityRequest checkoutUtilityRequest) throws ApiException, IOException { + return originKeys(checkoutUtilityRequest, null); + } + + /** + * Create originKey values for domains + * + * @param checkoutUtilityRequest {@link CheckoutUtilityRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CheckoutUtilityResponse } + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public CheckoutUtilityResponse originKeys(CheckoutUtilityRequest checkoutUtilityRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = checkoutUtilityRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/originKeys", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return CheckoutUtilityResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/resource/Resource.java b/src/main/java/com/adyen/service/resource/Resource.java index 8dc2e1e0f..8d4444124 100644 --- a/src/main/java/com/adyen/service/resource/Resource.java +++ b/src/main/java/com/adyen/service/resource/Resource.java @@ -23,6 +23,7 @@ import com.adyen.Config; import com.adyen.Service; import com.adyen.constants.ApiConstants; +import com.adyen.enums.Environment; import com.adyen.httpclient.ClientInterface; import com.adyen.httpclient.HTTPClientException; import com.adyen.model.ApiError; diff --git a/src/test/java/com/adyen/CheckoutTest.java b/src/test/java/com/adyen/CheckoutTest.java index a8abd0fd6..bf08d76b8 100644 --- a/src/test/java/com/adyen/CheckoutTest.java +++ b/src/test/java/com/adyen/CheckoutTest.java @@ -20,28 +20,26 @@ */ package com.adyen; +import com.adyen.constants.ApiConstants; import com.adyen.enums.Environment; import com.adyen.httpclient.AdyenHttpClient; import com.adyen.httpclient.HTTPClientException; import com.adyen.model.checkout.*; -import com.adyen.service.Checkout; +import com.adyen.service.checkout.*; import org.junit.Assert; import org.junit.Test; -import javax.sound.sampled.Line; -import java.io.Console; import java.io.IOException; import java.time.OffsetDateTime; -import java.time.chrono.Chronology; -import java.time.temporal.TemporalField; import java.util.*; import static org.junit.Assert.*; import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; public class CheckoutTest extends BaseTest { @@ -75,42 +73,13 @@ public void TestPaymentSuccess() throws Exception { PaymentRequest paymentRequest = new PaymentRequest(); paymentRequest.setAmount(amount); paymentRequest.setPaymentMethod(new PaymentDonationRequestPaymentMethod(cardDetails)); - Checkout checkout = new Checkout(client); + PaymentsApi checkout = new PaymentsApi(client); PaymentResponse paymentResponse = checkout.payments(paymentRequest); assertEquals("993617895204576J", paymentResponse.getPspReference()); assertEquals(CheckoutRedirectAction.TypeEnum.REDIRECT, paymentResponse.getAction().getCheckoutRedirectAction().getType()); assertEquals("https://checkoutshopper-test.adyen.com/checkoutshopper/threeDS/redirect?MD=M2R...", paymentResponse.getAction().getCheckoutRedirectAction().getUrl()); } - /** - * Should set default applicationInfo - */ - @Test - public void TestPaymentDefaultApplicationInfo() throws Exception { - Client client = createMockClientFromFile("mocks/checkout/paymentResponse.json"); - Amount amount = new Amount().currency("EUR").value(1000L); - CardDetails cardDetails = new CardDetails(); - cardDetails.encryptedCardNumber("5136333333333335") - .holderName("John Doe") - .cvc("737") - .encryptedExpiryMonth("08") - .encryptedExpiryYear("2018"); - cardDetails.setType(CardDetails.TypeEnum.SCHEME); - PaymentRequest paymentRequest = new PaymentRequest(); - paymentRequest.setAmount(amount); - paymentRequest.setPaymentMethod(new PaymentDonationRequestPaymentMethod(cardDetails)); - - assertNull(paymentRequest.getApplicationInfo()); - assertNull(paymentRequest.getApplicationInfo()); - - Checkout checkout = new Checkout(client); - checkout.payments(paymentRequest); - - assertNotNull(paymentRequest.getApplicationInfo()); - assertEquals(Client.LIB_NAME, paymentRequest.getApplicationInfo().getAdyenLibrary().getName()); - assertEquals(Client.LIB_VERSION, paymentRequest.getApplicationInfo().getAdyenLibrary().getVersion()); - } - /** * Should be able to stringify and parse paymentMethod in PaymentRequest (test oneOf serialization and deserialization) */ @@ -140,7 +109,7 @@ public void TestPaymentMethodsSuccess() throws Exception { Client client = createMockClientFromFile("mocks/checkout/paymentMethodsResponse.json"); PaymentMethodsRequest paymentMethodsRequest = new PaymentMethodsRequest(); paymentMethodsRequest.setMerchantAccount("myMerchantAccount"); - Checkout checkout = new Checkout(client); + PaymentsApi checkout = new PaymentsApi(client); PaymentMethodsResponse paymentMethodsResponse = checkout.paymentMethods(paymentMethodsRequest); assertEquals(1, paymentMethodsResponse.getPaymentMethods().size()); assertEquals("klarna", paymentMethodsResponse.getPaymentMethods().get(0).getType()); @@ -163,7 +132,7 @@ public void TestPaymentLinkSuccess() throws Exception { List lineItemList = new ArrayList(); lineItemList.add(lineItem); createPaymentLinkRequest.setLineItems(lineItemList); - Checkout checkout = new Checkout(client); + PaymentLinksApi checkout = new PaymentLinksApi(client); PaymentLinkResponse paymentLinkResponse = checkout.paymentLinks(createPaymentLinkRequest); assertEquals("https://test.adyen.link/PL6DB3157D27FFBBCF", paymentLinkResponse.getUrl()); assertEquals(PaymentLinkResponse.StatusEnum.ACTIVE, paymentLinkResponse.getStatus()); @@ -176,8 +145,8 @@ public void TestPaymentLinkSuccess() throws Exception { public void TestGetPaymentLinkSuccess() throws Exception { Client client = createMockClientFromFile("mocks/checkout/getPaymentLinkResponse.json"); - Checkout checkout = new Checkout(client); - PaymentLinkResponse paymentLinkResponse = checkout.getPaymentLinks("linkId"); + PaymentLinksApi checkout = new PaymentLinksApi(client); + PaymentLinkResponse paymentLinkResponse = checkout.getPaymentLink("linkId"); assertEquals("shopper-reference", paymentLinkResponse.getReference()); assertEquals(PaymentLinkResponse.StatusEnum.EXPIRED, paymentLinkResponse.getStatus()); } @@ -191,8 +160,8 @@ public void TestPatchPaymentLinkSuccess() throws Exception { UpdatePaymentLinkRequest updatePaymentLinkRequest = new UpdatePaymentLinkRequest(); updatePaymentLinkRequest.setStatus(UpdatePaymentLinkRequest.StatusEnum.EXPIRED); - Checkout checkout = new Checkout(client); - PaymentLinkResponse paymentLinkResponse = checkout.patchPaymentLinks("linkId", updatePaymentLinkRequest); + PaymentLinksApi checkout = new PaymentLinksApi(client); + PaymentLinkResponse paymentLinkResponse = checkout.updatePaymentLink("linkId", updatePaymentLinkRequest); assertEquals("shopper-reference", paymentLinkResponse.getReference()); assertEquals(PaymentLinkResponse.StatusEnum.EXPIRED, paymentLinkResponse.getStatus()); } @@ -205,7 +174,7 @@ public void TestPaymentDetailsSuccess() throws Exception { Client client = createMockClientFromFile("mocks/checkout/paymentDetailsResponse.json"); DetailsRequest detailsRequest = new DetailsRequest(); detailsRequest.setPaymentData("STATE_DATA"); - Checkout checkout = new Checkout(client); + PaymentsApi checkout = new PaymentsApi(client); PaymentDetailsResponse paymentDetailsResponse = checkout.paymentsDetails(detailsRequest); assertEquals(PaymentDetailsResponse.ResultCodeEnum.AUTHORISED, paymentDetailsResponse.getResultCode()); assertEquals("V4HZ4RBFJGXXGN82", paymentDetailsResponse.getPspReference()); @@ -224,7 +193,7 @@ public void TestCreateSessionsSuccessCall() throws Exception { sessionRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT"); Amount amount = new Amount().currency("EUR").value(100L); sessionRequest.setAmount(amount); - Checkout checkout = new Checkout(client); + PaymentsApi checkout = new PaymentsApi(client); CreateCheckoutSessionResponse createCheckoutSessionResponse = checkout.sessions(sessionRequest); assertEquals("Ab02b4c0!BFHSPFBQTEwM0NBNTM3RfCf5", createCheckoutSessionResponse.getSessionData()); assertEquals("CS1453E3730C313478", createCheckoutSessionResponse.getId()); @@ -240,8 +209,8 @@ public void TestPaymentsResultsSuccessCall() throws Exception { Client client = createMockClientFromFile("mocks/checkout/paymentResultsResponse.json"); PaymentVerificationRequest paymentVerificationRequest = new PaymentVerificationRequest(); paymentVerificationRequest.setPayload("PAYLOAD"); - Checkout checkout = new Checkout(client); - PaymentVerificationResponse paymentVerificationResponse = checkout.paymentResult(paymentVerificationRequest); + ClassicCheckoutSdkApi checkout = new ClassicCheckoutSdkApi(client); + PaymentVerificationResponse paymentVerificationResponse = checkout.verifyPaymentResult(paymentVerificationRequest); assertEquals(PaymentVerificationResponse.ResultCodeEnum.AUTHORISED, paymentVerificationResponse.getResultCode()); assertEquals("V4HZ4RBFJGXXGN82", paymentVerificationResponse.getPspReference()); } @@ -257,7 +226,7 @@ public void TestCreateOrderSuccessCall() throws Exception { checkoutCreateOrderRequest.setAmount(amount); checkoutCreateOrderRequest.setReference("YOUR_ORDER_REFERENCE"); checkoutCreateOrderRequest.setMerchantAccount("YOUR_MERCHANT_ACOUNT"); - Checkout checkout = new Checkout(client); + OrdersApi checkout = new OrdersApi(client); CheckoutCreateOrderResponse checkoutCreateOrderResponse= checkout.orders(checkoutCreateOrderRequest); assertEquals("8616178914061985", checkoutCreateOrderResponse.getPspReference()); assertEquals("Abzt3JH4wnzErMnOZwSdgA==", checkoutCreateOrderResponse.getOrderData()); @@ -286,12 +255,12 @@ public void TestCancelOrderSuccessCall() throws Exception { Client client = createMockClientFromFile("mocks/checkout/cancelOrderResponse.json"); CheckoutCancelOrderRequest checkoutCancelOrderRequest = new CheckoutCancelOrderRequest(); checkoutCancelOrderRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT"); - CheckoutOrder checkoutOrder = new CheckoutOrder(); - checkoutOrder.setPspReference("8815517812932012"); - checkoutOrder.setOrderData("823fh892f8f18f4...148f13f9f3f"); - checkoutCancelOrderRequest.setOrder(checkoutOrder); - Checkout checkout = new Checkout(client); - CheckoutCancelOrderResponse checkoutCancelOrderResponse = checkout.ordersCancel(checkoutCancelOrderRequest); + EncryptedOrderData encryptedOrderData = new EncryptedOrderData(); + encryptedOrderData.setPspReference("8815517812932012"); + encryptedOrderData.setOrderData("823fh892f8f18f4...148f13f9f3f"); + checkoutCancelOrderRequest.setOrder(encryptedOrderData); + OrdersApi checkout = new OrdersApi(client); + CheckoutCancelOrderResponse checkoutCancelOrderResponse = checkout.cancelOrder(checkoutCancelOrderRequest); assertEquals(CheckoutCancelOrderResponse.ResultCodeEnum.RECEIVED, checkoutCancelOrderResponse.getResultCode()); assertEquals("8816178914079738", checkoutCancelOrderResponse.getPspReference()); } @@ -306,8 +275,8 @@ public void TestApplePaySessionsSuccessCall() throws Exception { createApplePaySessionRequest.setDisplayName("YOUR_MERCHANT_NAME"); createApplePaySessionRequest.setDomainName("YOUR_DOMAIN_NAME"); createApplePaySessionRequest.setMerchantIdentifier("YOUR_MERCHANT_ID"); - Checkout checkout = new Checkout(client); - ApplePaySessionResponse applePaySessionResponse = checkout.applePaySessions(createApplePaySessionRequest); + UtilityApi checkout = new UtilityApi(client); + ApplePaySessionResponse applePaySessionResponse = checkout.getApplePaySession(createApplePaySessionRequest); assertEquals("eyJ2Z", applePaySessionResponse.getData()); } @@ -326,7 +295,7 @@ public void TestDonationsSuccessCall() throws Exception { paymentDonationRequest.paymentMethod(new PaymentDonationRequestPaymentMethod(cardDetails)); paymentDonationRequest.setReference("YOUR_MERCHANT_REFERENCE"); paymentDonationRequest.setReturnUrl("https://your-company.com/..."); - Checkout checkout = new Checkout(client); + PaymentsApi checkout = new PaymentsApi(client); DonationResponse donationResponse = checkout.donations(paymentDonationRequest); assertEquals(PaymentResponse.ResultCodeEnum.AUTHORISED ,donationResponse.getPayment().getResultCode()); assertEquals("UNIQUE_RESOURCE_ID", donationResponse.getId()); @@ -339,10 +308,10 @@ public void TestDonationsSuccessCall() throws Exception { @Test public void TestPaymenUpdateAmountSuccessCall() throws Exception { Client client = createMockClientFromFile("mocks/checkout/paymentUpdateAmountResponse.json"); - Checkout checkout = new Checkout(client); + ModificationsApi checkout = new ModificationsApi(client); CreatePaymentAmountUpdateRequest createPaymentAmountUpdateRequest = new CreatePaymentAmountUpdateRequest(); createPaymentAmountUpdateRequest.setIndustryUsage(CreatePaymentAmountUpdateRequest.IndustryUsageEnum.DELAYEDCHARGE); - PaymentAmountUpdateResource paymentAmountUpdateResource = checkout.paymentsAmountUpdates("pspRef", createPaymentAmountUpdateRequest); + PaymentAmountUpdateResource paymentAmountUpdateResource = checkout.updateAuthorisedAmount("pspRef", createPaymentAmountUpdateRequest); assertEquals(PaymentAmountUpdateResource.IndustryUsageEnum.DELAYEDCHARGE ,paymentAmountUpdateResource.getIndustryUsage()); assertEquals("1234567890", paymentAmountUpdateResource.getPaymentPspReference()); assertEquals(PaymentAmountUpdateResource.StatusEnum.RECEIVED, paymentAmountUpdateResource.getStatus()); @@ -357,7 +326,7 @@ public void TestCardDetailsRequestSuccess() throws Exception { CardDetailsRequest cardDetailsRequest = new CardDetailsRequest(); cardDetailsRequest.setCardNumber("123412341234"); cardDetailsRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT"); - Checkout checkout = new Checkout(client); + PaymentsApi checkout = new PaymentsApi(client); CardDetailsResponse cardDetailsResponse = checkout.cardDetails(cardDetailsRequest); assertEquals(2, cardDetailsResponse.getBrands().size()); assertEquals("visa", cardDetailsResponse.getBrands().get(0).getType()); @@ -389,11 +358,8 @@ public void TestDateSerialization() throws Exception { @Test public void TestGetStoredPaymentMethods() throws Exception { Client client = createMockClientFromFile("mocks/checkout/getStoredPaymentMethodResponse.json"); - Checkout checkout = new Checkout(client); - HashMap map = new HashMap<>(); - map.put("merchantAccount", "TestMerchantAccount"); - map.put("shopperReference", "test-1234"); - ListStoredPaymentMethodsResponse response = checkout.getStoredPaymentDetails(map); + RecurringApi checkout = new RecurringApi(client); + ListStoredPaymentMethodsResponse response = checkout.getTokensForStoredPaymentDetails("test-1234", "TestMerchantAccount", null); Assert.assertEquals(response.getMerchantAccount(), "merchantAccount"); Assert.assertEquals(response.getStoredPaymentMethods().get(0).getBrand(), "string"); } @@ -403,11 +369,33 @@ public void TestGetStoredPaymentMethods() throws Exception { */ @Test public void TestDeleteStoredPaymentMethods() throws Exception { - Client client = createMockClientFromFile("mocks/checkout/getStoredPaymentMethodResponse.json"); - Checkout checkout = new Checkout(client); - HashMap map = new HashMap<>(); - map.put("merchantAccount", "TestMerchantAccount"); - map.put("shopperReference", "test-1234"); - checkout.deleteStoredPaymentDetails("recurringId", map); + Client client = createMockClientFromFile("mocks/checkout/deleteStoredPaymentMethodResponse.json"); + RecurringApi checkout = new RecurringApi(client); + StoredPaymentMethodResource response = checkout.deleteTokenForStoredPaymentDetails("recurringId", "test-1234", "TestMerchantAccount"); + assertEquals(response.getType(), "string"); + } + + /** + * Should delete StoredPaymentMethods + */ + @Test + public void TestLiveURLCheckout() throws Exception { + Client client = createMockClientFromFile("mocks/checkout/deleteStoredPaymentMethodResponse.json"); + client.setEnvironment(Environment.LIVE, "prefix"); + RecurringApi checkout = new RecurringApi(client); + checkout.deleteTokenForStoredPaymentDetails("recurringId", "test-1234", "TestMerchantAccount"); + HashMap queryParams = new HashMap(); + queryParams.put("merchantAccount", "TestMerchantAccount"); + queryParams.put("shopperReference", "test-1234"); + + verify(client.getHttpClient()).request( + "https://prefix-checkout-live.adyenpayments.com/checkout/v70/storedPaymentMethods/recurringId", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.DELETE, + queryParams + ); } } diff --git a/src/test/resources/mocks/checkout/deleteStoredPaymentMethodResponse.json b/src/test/resources/mocks/checkout/deleteStoredPaymentMethodResponse.json new file mode 100644 index 000000000..89710cd38 --- /dev/null +++ b/src/test/resources/mocks/checkout/deleteStoredPaymentMethodResponse.json @@ -0,0 +1,21 @@ +{ + "brand": "string", + "expiryMonth": "string", + "expiryYear": "string", + "externalResponseCode": "string", + "externalTokenReference": "string", + "holderName": "string", + "iban": "string", + "id": "string", + "issuerName": "string", + "lastFour": "string", + "name": "string", + "networkTxReference": "string", + "ownerName": "string", + "shopperEmail": "string", + "shopperReference": "string", + "supportedRecurringProcessingModels": [ + "string" + ], + "type": "string" +} \ No newline at end of file diff --git a/templates/libraries/okhttp-gson/api.mustache b/templates/libraries/okhttp-gson/api.mustache index fe99720ce..14006d2cd 100644 --- a/templates/libraries/okhttp-gson/api.mustache +++ b/templates/libraries/okhttp-gson/api.mustache @@ -1,72 +1,73 @@ {{>licenseInfo}} - package {{package}}; -import com.adyen.ApiKeyAuthenticatedService; import com.adyen.Client; +import com.adyen.Service; import com.adyen.constants.ApiConstants; {{#imports}}import {{import}}; {{/imports}} +import com.adyen.model.RequestOptions; import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.{{resourceClass}}; +import com.adyen.service.resource.Resource; import java.io.IOException; import java.util.HashMap; import java.util.Map; {{#operations}} -public class {{classname}} extends ApiKeyAuthenticatedService { +public class {{classname}} extends Service { + private final String baseURL; + public {{classname}}(Client client) { super(client); + this.baseURL = createBaseURL("{{{basePath}}}"); } - {{#operation}} - /** - * {{summary}} - * - {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} - {{/allParams}} - {{#queryParams}} - * {{paramName}}: {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} - {{/queryParams}} - {{#returnType}} - * @return {{.}} - {{/returnType}} - * @throws ApiException if fails to make API call - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - {{#externalDocs}} - * {{description}} - * @see {{summary}} Documentation - {{/externalDocs}} - */ - {{#isDeprecated}} + +{{>api_summary_overload}} +{{#isDeprecated}} + @Deprecated +{{/isDeprecated}} + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{#vendorExtensions.x-methodName}}{{.}}{{/vendorExtensions.x-methodName}}{{^vendorExtensions.x-methodName}}{{operationId}}{{/vendorExtensions.x-methodName}}({{>api_overload}}) throws ApiException, IOException { + {{#returnType}}return {{/returnType}}{{#vendorExtensions.x-methodName}}{{.}}{{/vendorExtensions.x-methodName}}{{^vendorExtensions.x-methodName}}{{operationId}}{{/vendorExtensions.x-methodName}}({{>api_overload_invoke}}); + } + +{{>api_summary}} +{{#isDeprecated}} @Deprecated - {{/isDeprecated}} - public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{#vendorExtensions.x-methodName}}{{.}}{{/vendorExtensions.x-methodName}}{{^vendorExtensions.x-methodName}}{{operationId}}{{/vendorExtensions.x-methodName}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, IOException { +{{/isDeprecated}} + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{#vendorExtensions.x-methodName}}{{.}}{{/vendorExtensions.x-methodName}}{{^vendorExtensions.x-methodName}}{{operationId}}{{/vendorExtensions.x-methodName}}({{>api_parameters}}) throws ApiException, IOException { {{! verify if a required parameter is set }} -{{#allParams}}{{#required}} if ({{paramName}} == null) { - throw new ApiException("Missing the required parameter '{{paramName}}'", 400); - } -{{/required}}{{/allParams}} + {{#hasPathParams}} + //Add path params Map pathParams = new HashMap<>(); -{{#pathParams}} + {{#pathParams}} + if ({{{paramName}}} == null) { + throw new IllegalArgumentException("Please provide the {{{paramName}}} path parameter"); + } pathParams.put("{{baseName}}", {{{paramName}}}); -{{/pathParams}} + {{/pathParams}} + {{/hasPathParams}} + {{#hasQueryParams}} + //Add query params + Map queryParams = new HashMap<>(); + {{#queryParams}} + if ({{{paramName}}} != null) { + queryParams.put("{{baseName}}", {{{paramName}}}{{^isString}}.toString(){{/isString}}); + } + {{/queryParams}} + {{/hasQueryParams}} String requestBody = {{#bodyParam}}{{paramName}}.toJson(){{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; - {{resourceClass}} resource = new {{resourceClass}}(this, "{{{path}}}"); + Resource resource = new Resource(this, this.baseURL + "{{{path}}}", null); {{#returnType}} - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.{{httpMethod}}, pathParams{{#hasQueryParams}}, queryParams{{/hasQueryParams}}); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.{{httpMethod}}, {{#hasPathParams}}pathParams{{/hasPathParams}}{{^hasPathParams}}null{{/hasPathParams}}{{#hasQueryParams}}, queryParams{{/hasQueryParams}}); return {{#returnType}}{{{.}}}.fromJson(jsonResult){{/returnType}}; {{/returnType}} {{^returnType}} - resource.request(requestBody, null, ApiConstants.HttpMethod.{{httpMethod}}, pathParams{{#hasQueryParams}}, queryParams{{/hasQueryParams}}); + resource.request(requestBody, null, ApiConstants.HttpMethod.{{httpMethod}}, {{#hasPathParams}}pathParams{{/hasPathParams}}{{^hasPathParams}}null{{/hasPathParams}}{{#hasQueryParams}}, queryParams{{/hasQueryParams}}); {{/returnType}} } - {{/operation}} } -{{/operations}} +{{/operations}} \ No newline at end of file diff --git a/templates/libraries/okhttp-gson/api_overload.mustache b/templates/libraries/okhttp-gson/api_overload.mustache new file mode 100644 index 000000000..853846e89 --- /dev/null +++ b/templates/libraries/okhttp-gson/api_overload.mustache @@ -0,0 +1,2 @@ +{{! Overload contains just required and body params }} +{{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#bodyParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}{{{dataType}}} {{paramName}}{{/bodyParams}} \ No newline at end of file diff --git a/templates/libraries/okhttp-gson/api_overload_invoke.mustache b/templates/libraries/okhttp-gson/api_overload_invoke.mustache new file mode 100644 index 000000000..52479b036 --- /dev/null +++ b/templates/libraries/okhttp-gson/api_overload_invoke.mustache @@ -0,0 +1,2 @@ +{{! Overload contains just required and body params, null on the remaining }} +{{#pathParams}}{{paramName}}, {{/pathParams}}{{#queryParams}}{{#required}}{{paramName}}, {{/required}}{{^required}}null, {{/required}} {{/queryParams}}{{#bodyParams}}{{paramName}}, {{/bodyParams}}null \ No newline at end of file diff --git a/templates/libraries/okhttp-gson/api_parameters.mustache b/templates/libraries/okhttp-gson/api_parameters.mustache new file mode 100644 index 000000000..4214551d2 --- /dev/null +++ b/templates/libraries/okhttp-gson/api_parameters.mustache @@ -0,0 +1,2 @@ +{{! Path and body are required, followed by optional query string and request options }} +{{#pathParams}}{{{dataType}}} {{paramName}}, {{/pathParams}}{{#queryParams}}{{{dataType}}} {{paramName}}, {{/queryParams}}{{#bodyParams}}{{{dataType}}} {{paramName}}, {{/bodyParams}}RequestOptions requestOptions \ No newline at end of file diff --git a/templates/libraries/okhttp-gson/api_single.mustache b/templates/libraries/okhttp-gson/api_single.mustache new file mode 100644 index 000000000..730154d4b --- /dev/null +++ b/templates/libraries/okhttp-gson/api_single.mustache @@ -0,0 +1,73 @@ +{{>licenseInfo}} +package {{package}}; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +{{#imports}}import {{import}}; +{{/imports}} +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +{{#operations}} +public class {{smallServiceName}} extends Service { + private final String baseURL; + + public {{smallServiceName}}(Client client) { + super(client); + this.baseURL = createBaseURL("{{{basePath}}}"); + } +{{#operation}} + +{{>api_summary_overload}} +{{#isDeprecated}} + @Deprecated +{{/isDeprecated}} + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{#vendorExtensions.x-methodName}}{{.}}{{/vendorExtensions.x-methodName}}{{^vendorExtensions.x-methodName}}{{operationId}}{{/vendorExtensions.x-methodName}}({{>api_overload}}) throws ApiException, IOException { + {{#returnType}}return {{/returnType}}{{#vendorExtensions.x-methodName}}{{.}}{{/vendorExtensions.x-methodName}}{{^vendorExtensions.x-methodName}}{{operationId}}{{/vendorExtensions.x-methodName}}({{>api_overload_invoke}}); + } + +{{>api_summary}} +{{#isDeprecated}} + @Deprecated +{{/isDeprecated}} + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{#vendorExtensions.x-methodName}}{{.}}{{/vendorExtensions.x-methodName}}{{^vendorExtensions.x-methodName}}{{operationId}}{{/vendorExtensions.x-methodName}}({{>api_parameters}}) throws ApiException, IOException { +{{! verify if a required parameter is set }} + {{#hasPathParams}} + //Add path params + Map pathParams = new HashMap<>(); + {{#pathParams}} + if ({{{paramName}}} == null) { + throw new IllegalArgumentException("Please provide the {{{paramName}}} path parameter"); + } + pathParams.put("{{baseName}}", {{{paramName}}}); + {{/pathParams}} + {{/hasPathParams}} + {{#hasQueryParams}} + //Add query params + Map queryParams = new HashMap<>(); + {{#queryParams}} + if ({{{paramName}}} != null) { + queryParams.put("{{baseName}}", {{{paramName}}}{{^isString}}.toString(){{/isString}}); + } + {{/queryParams}} + {{/hasQueryParams}} + + String requestBody = {{#bodyParam}}{{paramName}}.toJson(){{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; + Resource resource = new Resource(this, this.baseURL + "{{{path}}}", null); + {{#returnType}} + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.{{httpMethod}}, {{#hasPathParams}}pathParams{{/hasPathParams}}{{^hasPathParams}}null{{/hasPathParams}}{{#hasQueryParams}}, queryParams{{/hasQueryParams}}); + return {{#returnType}}{{{.}}}.fromJson(jsonResult){{/returnType}}; + {{/returnType}} + {{^returnType}} + resource.request(requestBody, null, ApiConstants.HttpMethod.{{httpMethod}}, {{#hasPathParams}}pathParams{{/hasPathParams}}{{^hasPathParams}}null{{/hasPathParams}}{{#hasQueryParams}}, queryParams{{/hasQueryParams}}); + {{/returnType}} + } +{{/operation}} +} +{{/operations}} \ No newline at end of file diff --git a/templates/libraries/okhttp-gson/api_summary.mustache b/templates/libraries/okhttp-gson/api_summary.mustache new file mode 100644 index 000000000..391b0a558 --- /dev/null +++ b/templates/libraries/okhttp-gson/api_summary.mustache @@ -0,0 +1,25 @@ + /** + * {{summary}} + * +{{#pathParams}} + * @param {{paramName}} {@link {{dataType}} } {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} +{{/pathParams}} +{{#bodyParams}} + * @param {{paramName}} {@link {{dataType}} } {{description}} (required) +{{/bodyParams}} +{{#queryParams}} + * @param {{paramName}} {@link {{dataType}} } Query: {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} +{{/queryParams}} + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) +{{#returnType}} + * @return {@link {{.}} } +{{/returnType}} + * @throws ApiException if fails to make API call +{{#isDeprecated}} + * @deprecated +{{/isDeprecated}} +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ \ No newline at end of file diff --git a/templates/libraries/okhttp-gson/api_summary_overload.mustache b/templates/libraries/okhttp-gson/api_summary_overload.mustache new file mode 100644 index 000000000..0cd09dbea --- /dev/null +++ b/templates/libraries/okhttp-gson/api_summary_overload.mustache @@ -0,0 +1,21 @@ + /** + * {{summary}} + * +{{#requiredParams}} + * @param {{paramName}} {@link {{dataType}} } {{description}} (required) +{{/requiredParams}} +{{#bodyParams}} + * @param {{paramName}} {@link {{dataType}} } {{description}} (required) +{{/bodyParams}} +{{#returnType}} + * @return {@link {{.}} } +{{/returnType}} + * @throws ApiException if fails to make API call +{{#isDeprecated}} + * @deprecated +{{/isDeprecated}} +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ \ No newline at end of file diff --git a/templates/libraries/okhttp-gson/config.yaml b/templates/libraries/okhttp-gson/config.yaml new file mode 100644 index 000000000..d0c58bdf5 --- /dev/null +++ b/templates/libraries/okhttp-gson/config.yaml @@ -0,0 +1,6 @@ +templateDir: ./templates/libraries/okhttp-gson +files: + api_single.mustache: + folder: api + templateType: API + destinationFilename: Single.java \ No newline at end of file From 4e7926d890961f14ebba96bdfb77b46f3613c73a Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Fri, 21 Apr 2023 17:07:04 +0200 Subject: [PATCH 15/32] ITT-434 Rename PaymentDonationRequest -> CheckoutPaymentMethod (#1005) * renamed the PaymentDonation Class * remove old checkout class --- Makefile | 3 + ...Method.java => CheckoutPaymentMethod.java} | 116 ++-- .../java/com/adyen/model/checkout/JSON.java | 2 +- .../checkout/PaymentDonationRequest.java | 12 +- .../adyen/model/checkout/PaymentRequest.java | 12 +- src/main/java/com/adyen/service/Checkout.java | 636 ------------------ src/test/java/com/adyen/CheckoutTest.java | 6 +- .../java/com/adyen/DateSerializationTest.java | 26 +- .../java/com/adyen/ErrorHandlingTest.java | 11 +- 9 files changed, 94 insertions(+), 730 deletions(-) rename src/main/java/com/adyen/model/checkout/{PaymentDonationRequestPaymentMethod.java => CheckoutPaymentMethod.java} (95%) delete mode 100644 src/main/java/com/adyen/service/Checkout.java diff --git a/Makefile b/Makefile index eb94ecf29..ff0b181aa 100644 --- a/Makefile +++ b/Makefile @@ -52,6 +52,7 @@ $(services): target/spec $(openapi-generator-jar) --library $(library) \ --global-property modelDocs=false \ --global-property modelTests=false \ + --inline-schema-name-mappings PaymentDonationRequest_paymentMethod=CheckoutPaymentMethod \ --additional-properties=dateLibrary=java8 \ --additional-properties=serializationLibrary=gson \ --additional-properties=openApiNullable=false \ @@ -82,6 +83,7 @@ $(bigServices): target/spec $(openapi-generator-jar) --api-name-suffix Api \ --global-property modelDocs=false \ --global-property modelTests=false \ + --inline-schema-name-mappings PaymentDonationRequest_paymentMethod=CheckoutPaymentMethod \ --additional-properties=dateLibrary=java8 \ --additional-properties=serializationLibrary=gson \ --additional-properties=openApiNullable=false @@ -107,6 +109,7 @@ $(singleFileServices): target/spec $(openapi-generator-jar) --api-name-suffix Api \ --global-property modelDocs=false \ --global-property modelTests=false \ + --inline-schema-name-mappings PaymentDonationRequest_paymentMethod=CheckoutPaymentMethod \ --additional-properties=dateLibrary=java8 \ --additional-properties=serializationLibrary=gson \ --additional-properties=openApiNullable=false \ diff --git a/src/main/java/com/adyen/model/checkout/PaymentDonationRequestPaymentMethod.java b/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java similarity index 95% rename from src/main/java/com/adyen/model/checkout/PaymentDonationRequestPaymentMethod.java rename to src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java index 2964dce4b..781f3a7d7 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDonationRequestPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java @@ -96,15 +96,15 @@ import com.adyen.model.checkout.JSON; -public class PaymentDonationRequestPaymentMethod extends AbstractOpenApiSchema { - private static final Logger log = Logger.getLogger(PaymentDonationRequestPaymentMethod.class.getName()); +public class CheckoutPaymentMethod extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(CheckoutPaymentMethod.class.getName()); public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!PaymentDonationRequestPaymentMethod.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'PaymentDonationRequestPaymentMethod' and its subtypes + if (!CheckoutPaymentMethod.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CheckoutPaymentMethod' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter adapterAchDetails = gson.getDelegateAdapter(this, TypeToken.get(AchDetails.class)); @@ -147,9 +147,9 @@ public TypeAdapter create(Gson gson, TypeToken type) { final TypeAdapter adapterWeChatPayMiniProgramDetails = gson.getDelegateAdapter(this, TypeToken.get(WeChatPayMiniProgramDetails.class)); final TypeAdapter adapterZipDetails = gson.getDelegateAdapter(this, TypeToken.get(ZipDetails.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, PaymentDonationRequestPaymentMethod value) throws IOException { + public void write(JsonWriter out, CheckoutPaymentMethod value) throws IOException { if (value == null || value.getActualInstance() == null) { elementAdapter.write(out, null); return; @@ -432,7 +432,7 @@ public void write(JsonWriter out, PaymentDonationRequestPaymentMethod value) thr } @Override - public PaymentDonationRequestPaymentMethod read(JsonReader in) throws IOException { + public CheckoutPaymentMethod read(JsonReader in) throws IOException { Object deserialized = null; JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); @@ -948,12 +948,12 @@ public PaymentDonationRequestPaymentMethod read(JsonReader in) throws IOExceptio } if (match == 1) { - PaymentDonationRequestPaymentMethod ret = new PaymentDonationRequestPaymentMethod(); + CheckoutPaymentMethod ret = new CheckoutPaymentMethod(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } - throw new IOException(String.format("Failed deserialization for PaymentDonationRequestPaymentMethod: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + throw new IOException(String.format("Failed deserialization for CheckoutPaymentMethod: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); } }.nullSafe(); } @@ -962,201 +962,201 @@ public PaymentDonationRequestPaymentMethod read(JsonReader in) throws IOExceptio // store a list of schema names defined in oneOf public static final Map schemas = new HashMap(); - public PaymentDonationRequestPaymentMethod() { + public CheckoutPaymentMethod() { super("oneOf", Boolean.FALSE); } - public PaymentDonationRequestPaymentMethod(AchDetails o) { + public CheckoutPaymentMethod(AchDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(AfterpayDetails o) { + public CheckoutPaymentMethod(AfterpayDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(AmazonPayDetails o) { + public CheckoutPaymentMethod(AmazonPayDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(AndroidPayDetails o) { + public CheckoutPaymentMethod(AndroidPayDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(ApplePayDetails o) { + public CheckoutPaymentMethod(ApplePayDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(BacsDirectDebitDetails o) { + public CheckoutPaymentMethod(BacsDirectDebitDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(BillDeskDetails o) { + public CheckoutPaymentMethod(BillDeskDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(BlikDetails o) { + public CheckoutPaymentMethod(BlikDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(CardDetails o) { + public CheckoutPaymentMethod(CardDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(CellulantDetails o) { + public CheckoutPaymentMethod(CellulantDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(DokuDetails o) { + public CheckoutPaymentMethod(DokuDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(DotpayDetails o) { + public CheckoutPaymentMethod(DotpayDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(DragonpayDetails o) { + public CheckoutPaymentMethod(DragonpayDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(EcontextVoucherDetails o) { + public CheckoutPaymentMethod(EcontextVoucherDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(GenericIssuerPaymentMethodDetails o) { + public CheckoutPaymentMethod(GenericIssuerPaymentMethodDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(GiropayDetails o) { + public CheckoutPaymentMethod(GiropayDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(GooglePayDetails o) { + public CheckoutPaymentMethod(GooglePayDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(IdealDetails o) { + public CheckoutPaymentMethod(IdealDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(KlarnaDetails o) { + public CheckoutPaymentMethod(KlarnaDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(MasterpassDetails o) { + public CheckoutPaymentMethod(MasterpassDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(MbwayDetails o) { + public CheckoutPaymentMethod(MbwayDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(MobilePayDetails o) { + public CheckoutPaymentMethod(MobilePayDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(MolPayDetails o) { + public CheckoutPaymentMethod(MolPayDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(OpenInvoiceDetails o) { + public CheckoutPaymentMethod(OpenInvoiceDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(PayPalDetails o) { + public CheckoutPaymentMethod(PayPalDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(PayUUpiDetails o) { + public CheckoutPaymentMethod(PayUUpiDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(PayWithGoogleDetails o) { + public CheckoutPaymentMethod(PayWithGoogleDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(PaymentDetails o) { + public CheckoutPaymentMethod(PaymentDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(RatepayDetails o) { + public CheckoutPaymentMethod(RatepayDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(SamsungPayDetails o) { + public CheckoutPaymentMethod(SamsungPayDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(SepaDirectDebitDetails o) { + public CheckoutPaymentMethod(SepaDirectDebitDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(StoredPaymentMethodDetails o) { + public CheckoutPaymentMethod(StoredPaymentMethodDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(UpiCollectDetails o) { + public CheckoutPaymentMethod(UpiCollectDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(UpiIntentDetails o) { + public CheckoutPaymentMethod(UpiIntentDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(VippsDetails o) { + public CheckoutPaymentMethod(VippsDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(VisaCheckoutDetails o) { + public CheckoutPaymentMethod(VisaCheckoutDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(WeChatPayDetails o) { + public CheckoutPaymentMethod(WeChatPayDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(WeChatPayMiniProgramDetails o) { + public CheckoutPaymentMethod(WeChatPayMiniProgramDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } - public PaymentDonationRequestPaymentMethod(ZipDetails o) { + public CheckoutPaymentMethod(ZipDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } @@ -1244,7 +1244,7 @@ public PaymentDonationRequestPaymentMethod(ZipDetails o) { @Override public Map getSchemas() { - return PaymentDonationRequestPaymentMethod.schemas; + return CheckoutPaymentMethod.schemas; } /** @@ -1900,7 +1900,7 @@ public ZipDetails getZipDetails() throws ClassCastException { * Validates the JSON Object and throws an exception if issues found * * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to PaymentDonationRequestPaymentMethod + * @throws IOException if the JSON Object is invalid with respect to CheckoutPaymentMethod */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate oneOf schemas one by one @@ -2219,23 +2219,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // continue to the next one } if (validCount != 1) { - throw new IOException(String.format("The JSON string is invalid for PaymentDonationRequestPaymentMethod with oneOf schemas: AchDetails, AfterpayDetails, AmazonPayDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EcontextVoucherDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayPalDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, RatepayDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + throw new IOException(String.format("The JSON string is invalid for CheckoutPaymentMethod with oneOf schemas: AchDetails, AfterpayDetails, AmazonPayDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EcontextVoucherDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayPalDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, RatepayDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); } } /** - * Create an instance of PaymentDonationRequestPaymentMethod given an JSON string + * Create an instance of CheckoutPaymentMethod given an JSON string * * @param jsonString JSON string - * @return An instance of PaymentDonationRequestPaymentMethod - * @throws IOException if the JSON string is invalid with respect to PaymentDonationRequestPaymentMethod + * @return An instance of CheckoutPaymentMethod + * @throws IOException if the JSON string is invalid with respect to CheckoutPaymentMethod */ - public static PaymentDonationRequestPaymentMethod fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, PaymentDonationRequestPaymentMethod.class); + public static CheckoutPaymentMethod fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CheckoutPaymentMethod.class); } /** - * Convert an instance of PaymentDonationRequestPaymentMethod to an JSON string + * Convert an instance of CheckoutPaymentMethod to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/adyen/model/checkout/JSON.java b/src/main/java/com/adyen/model/checkout/JSON.java index 007ffd2cc..1344056cd 100644 --- a/src/main/java/com/adyen/model/checkout/JSON.java +++ b/src/main/java/com/adyen/model/checkout/JSON.java @@ -140,6 +140,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.CheckoutCreateOrderResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.CheckoutNativeRedirectAction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.CheckoutOrderResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.CheckoutPaymentMethod.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.CheckoutQrCodeAction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.CheckoutRedirectAction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.CheckoutSDKAction.CustomTypeAdapterFactory()); @@ -207,7 +208,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.PaymentDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.PaymentDetailsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.PaymentDonationRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.PaymentDonationRequestPaymentMethod.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.PaymentLinkResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.PaymentMethod.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.checkout.PaymentMethodGroup.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java b/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java index 2f8e9d64c..0f723e0a9 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java @@ -20,6 +20,7 @@ import com.adyen.model.checkout.ApplicationInfo; import com.adyen.model.checkout.AuthenticationData; import com.adyen.model.checkout.BrowserInfo; +import com.adyen.model.checkout.CheckoutPaymentMethod; import com.adyen.model.checkout.Company; import com.adyen.model.checkout.EncryptedOrderData; import com.adyen.model.checkout.ForexQuote; @@ -28,7 +29,6 @@ import com.adyen.model.checkout.Mandate; import com.adyen.model.checkout.MerchantRiskIndicator; import com.adyen.model.checkout.Name; -import com.adyen.model.checkout.PaymentDonationRequestPaymentMethod; import com.adyen.model.checkout.PlatformChargebackLogic; import com.adyen.model.checkout.RiskData; import com.adyen.model.checkout.Split; @@ -385,7 +385,7 @@ public IndustryUsageEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_PAYMENT_METHOD = "paymentMethod"; @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) - private PaymentDonationRequestPaymentMethod paymentMethod; + private CheckoutPaymentMethod paymentMethod; public static final String SERIALIZED_NAME_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; @SerializedName(SERIALIZED_NAME_PLATFORM_CHARGEBACK_LOGIC) @@ -1526,7 +1526,7 @@ public void setOrigin(String origin) { } - public PaymentDonationRequest paymentMethod(PaymentDonationRequestPaymentMethod paymentMethod) { + public PaymentDonationRequest paymentMethod(CheckoutPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; return this; @@ -1538,12 +1538,12 @@ public PaymentDonationRequest paymentMethod(PaymentDonationRequestPaymentMethod **/ @ApiModelProperty(required = true, value = "") - public PaymentDonationRequestPaymentMethod getPaymentMethod() { + public CheckoutPaymentMethod getPaymentMethod() { return paymentMethod; } - public void setPaymentMethod(PaymentDonationRequestPaymentMethod paymentMethod) { + public void setPaymentMethod(CheckoutPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; } @@ -2535,7 +2535,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field `paymentMethod` if (jsonObj.getAsJsonObject("paymentMethod") != null) { - PaymentDonationRequestPaymentMethod.validateJsonObject(jsonObj.getAsJsonObject("paymentMethod")); + CheckoutPaymentMethod.validateJsonObject(jsonObj.getAsJsonObject("paymentMethod")); } // validate the optional field `platformChargebackLogic` if (jsonObj.getAsJsonObject("platformChargebackLogic") != null) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentRequest.java b/src/main/java/com/adyen/model/checkout/PaymentRequest.java index b98cb3393..4a9ef3860 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentRequest.java @@ -20,6 +20,7 @@ import com.adyen.model.checkout.ApplicationInfo; import com.adyen.model.checkout.AuthenticationData; import com.adyen.model.checkout.BrowserInfo; +import com.adyen.model.checkout.CheckoutPaymentMethod; import com.adyen.model.checkout.Company; import com.adyen.model.checkout.EncryptedOrderData; import com.adyen.model.checkout.ForexQuote; @@ -28,7 +29,6 @@ import com.adyen.model.checkout.Mandate; import com.adyen.model.checkout.MerchantRiskIndicator; import com.adyen.model.checkout.Name; -import com.adyen.model.checkout.PaymentDonationRequestPaymentMethod; import com.adyen.model.checkout.PlatformChargebackLogic; import com.adyen.model.checkout.RiskData; import com.adyen.model.checkout.Split; @@ -373,7 +373,7 @@ public IndustryUsageEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_PAYMENT_METHOD = "paymentMethod"; @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) - private PaymentDonationRequestPaymentMethod paymentMethod; + private CheckoutPaymentMethod paymentMethod; public static final String SERIALIZED_NAME_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; @SerializedName(SERIALIZED_NAME_PLATFORM_CHARGEBACK_LOGIC) @@ -1448,7 +1448,7 @@ public void setOrigin(String origin) { } - public PaymentRequest paymentMethod(PaymentDonationRequestPaymentMethod paymentMethod) { + public PaymentRequest paymentMethod(CheckoutPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; return this; @@ -1460,12 +1460,12 @@ public PaymentRequest paymentMethod(PaymentDonationRequestPaymentMethod paymentM **/ @ApiModelProperty(required = true, value = "") - public PaymentDonationRequestPaymentMethod getPaymentMethod() { + public CheckoutPaymentMethod getPaymentMethod() { return paymentMethod; } - public void setPaymentMethod(PaymentDonationRequestPaymentMethod paymentMethod) { + public void setPaymentMethod(CheckoutPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; } @@ -2435,7 +2435,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field `paymentMethod` if (jsonObj.getAsJsonObject("paymentMethod") != null) { - PaymentDonationRequestPaymentMethod.validateJsonObject(jsonObj.getAsJsonObject("paymentMethod")); + CheckoutPaymentMethod.validateJsonObject(jsonObj.getAsJsonObject("paymentMethod")); } // validate the optional field `platformChargebackLogic` if (jsonObj.getAsJsonObject("platformChargebackLogic") != null) { diff --git a/src/main/java/com/adyen/service/Checkout.java b/src/main/java/com/adyen/service/Checkout.java deleted file mode 100644 index 0e9e66e7c..000000000 --- a/src/main/java/com/adyen/service/Checkout.java +++ /dev/null @@ -1,636 +0,0 @@ -package com.adyen.service; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.model.RequestOptions; -import com.adyen.model.checkout.ApplePaySessionResponse; -import com.adyen.model.checkout.ApplicationInfo; -import com.adyen.model.checkout.CardDetailsRequest; -import com.adyen.model.checkout.CardDetailsResponse; -import com.adyen.model.checkout.CheckoutBalanceCheckRequest; -import com.adyen.model.checkout.CheckoutBalanceCheckResponse; -import com.adyen.model.checkout.CheckoutCancelOrderRequest; -import com.adyen.model.checkout.CheckoutCancelOrderResponse; -import com.adyen.model.checkout.CheckoutCreateOrderRequest; -import com.adyen.model.checkout.CheckoutCreateOrderResponse; -import com.adyen.model.checkout.CommonField; -import com.adyen.model.checkout.CreateApplePaySessionRequest; -import com.adyen.model.checkout.CreateCheckoutSessionRequest; -import com.adyen.model.checkout.CreateCheckoutSessionResponse; -import com.adyen.model.checkout.CreatePaymentAmountUpdateRequest; -import com.adyen.model.checkout.CreatePaymentCancelRequest; -import com.adyen.model.checkout.CreatePaymentCaptureRequest; -import com.adyen.model.checkout.CreatePaymentLinkRequest; -import com.adyen.model.checkout.CreatePaymentRefundRequest; -import com.adyen.model.checkout.CreatePaymentReversalRequest; -import com.adyen.model.checkout.CreateStandalonePaymentCancelRequest; -import com.adyen.model.checkout.DetailsRequest; -import com.adyen.model.checkout.DonationResponse; -import com.adyen.model.checkout.ListStoredPaymentMethodsResponse; -import com.adyen.model.checkout.PaymentAmountUpdateResource; -import com.adyen.model.checkout.PaymentCancelResource; -import com.adyen.model.checkout.PaymentCaptureResource; -import com.adyen.model.checkout.PaymentDetailsResponse; -import com.adyen.model.checkout.PaymentDonationRequest; -import com.adyen.model.checkout.PaymentLinkResponse; -import com.adyen.model.checkout.PaymentMethodsRequest; -import com.adyen.model.checkout.PaymentMethodsResponse; -import com.adyen.model.checkout.PaymentRefundResource; -import com.adyen.model.checkout.PaymentRequest; -import com.adyen.model.checkout.PaymentResponse; -import com.adyen.model.checkout.PaymentReversalResource; -import com.adyen.model.checkout.PaymentSetupRequest; -import com.adyen.model.checkout.PaymentSetupResponse; -import com.adyen.model.checkout.PaymentVerificationRequest; -import com.adyen.model.checkout.PaymentVerificationResponse; -import com.adyen.model.checkout.StandalonePaymentCancelResource; -import com.adyen.model.checkout.UpdatePaymentLinkRequest; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.CheckoutResource; - - -import java.io.IOException; -import java.util.Map; -import java.util.Optional; - -import static com.adyen.Client.LIB_NAME; -import static com.adyen.Client.LIB_VERSION; -import static com.adyen.constants.ApiConstants.HttpMethod.DELETE; -import static com.adyen.constants.ApiConstants.HttpMethod.GET; -import static com.adyen.constants.ApiConstants.HttpMethod.PATCH; - -public class Checkout extends ApiKeyAuthenticatedService { - - private final CheckoutResource cancels; - private final CheckoutResource payments; - private final CheckoutResource paymentMethods; - private final CheckoutResource paymentsDetails; - private final CheckoutResource paymentSession; - private final CheckoutResource paymentsResult; - private final CheckoutResource orders; - private final CheckoutResource ordersCancel; - private final CheckoutResource sessions; - private final CheckoutResource paymentMethodsBalance; - private final CheckoutResource applePaySessions; - private final CheckoutResource donations; - private final CheckoutResource cardDetails; - private final CheckoutResource paymentLinks; - private final CheckoutResource storedPaymentMethods; - - public Checkout(Client client) { - - super(client); - cancels = new CheckoutResource(this, "/cancels"); - payments = new CheckoutResource(this, "/payments"); - paymentMethods = new CheckoutResource(this, "/paymentMethods"); - paymentsDetails = new CheckoutResource(this, "/payments/details"); - paymentSession = new CheckoutResource(this, "/paymentSession"); - paymentsResult = new CheckoutResource(this, "/payments/result"); - orders = new CheckoutResource(this, "/orders"); - ordersCancel = new CheckoutResource(this, "/orders/cancel"); - sessions = new CheckoutResource(this, "/sessions"); - paymentMethodsBalance = new CheckoutResource(this, "/paymentMethods/balance"); - applePaySessions = new CheckoutResource(this, "/applePay/sessions"); - donations = new CheckoutResource(this, "/donations"); - cardDetails = new CheckoutResource(this, "/cardDetails"); - paymentLinks = new CheckoutResource(this, "/paymentLinks"); - storedPaymentMethods = new CheckoutResource(this, "/storedPaymentMethods"); - - } - - /** - * Get ApplicationInfo for checkout request objects. - * Fills the object with Library info and returns it so it can be set on the request object. - * @param applicationInfo ApplicationInfo - * @return ApplicationInfo - */ - private ApplicationInfo setApplicationInfo(ApplicationInfo applicationInfo) { - return Optional.ofNullable(applicationInfo) - .orElse(new ApplicationInfo()) - .adyenLibrary(new CommonField().name(LIB_NAME).version(LIB_VERSION)); - } - - /** - * POST /payments API call - * - * @param paymentRequest PaymentRequest - * @return PaymentResponse - * @throws ApiException if it fails to make API call ApiException - */ - public PaymentResponse payments(PaymentRequest paymentRequest) throws ApiException, IOException { - return payments(paymentRequest, null); - } - - /** - * POST /payments API call - * - * @param paymentRequest PaymentRequest - * @return PaymentResponse - * @throws ApiException if it fails to make API call ApiException - */ - public PaymentResponse payments(PaymentRequest paymentRequest, RequestOptions requestOptions) throws ApiException, IOException { - paymentRequest.setApplicationInfo(setApplicationInfo(paymentRequest.getApplicationInfo())); - String jsonRequest = paymentRequest.toJson(); - String jsonResult = payments.request(jsonRequest, requestOptions); - return PaymentResponse.fromJson(jsonResult); - } - - /** - * POST /paymentMethods API call - * - * @param paymentMethodsRequest PaymentMethodsRequest - * @return paymentMethodsResponse - * @throws ApiException if it fails to make API call ApiException - */ - public PaymentMethodsResponse paymentMethods(PaymentMethodsRequest paymentMethodsRequest) throws ApiException, IOException { - return paymentMethods(paymentMethodsRequest, null); - } - - /** - * POST /paymentMethods API call - * - * @param paymentMethodsRequest PaymentMethodsRequest - * @return paymentMethodsResponse - * @throws ApiException if it fails to make API call ApiException - */ - public PaymentMethodsResponse paymentMethods(PaymentMethodsRequest paymentMethodsRequest, RequestOptions requestOptions) throws ApiException, IOException { - String jsonRequest = paymentMethodsRequest.toJson(); - String jsonResult = paymentMethods.request(jsonRequest, requestOptions); - return PaymentMethodsResponse.fromJson(jsonResult); - } - - /** - * POST payments/details API call - * - * @param paymentsDetailsRequest paymentsDetailsRequest - * @return PaymentDetailsResponse - * @throws ApiException if it fails to make API call ApiException - */ - public PaymentDetailsResponse paymentsDetails(DetailsRequest paymentsDetailsRequest) throws ApiException, IOException { - return paymentsDetails(paymentsDetailsRequest, null); - } - - /** - * POST payments/details API call - * - * @param paymentsDetailsRequest paymentsDetailsRequest - * @return PaymentDetailsResponse - * @throws ApiException if it fails to make API call ApiException - */ - public PaymentDetailsResponse paymentsDetails(DetailsRequest paymentsDetailsRequest, RequestOptions requestOptions) throws ApiException, IOException { - String jsonRequest = paymentsDetailsRequest.toJson(); - String jsonResult = paymentsDetails.request(jsonRequest, requestOptions); - return PaymentDetailsResponse.fromJson(jsonResult); - } - - /** - * POST /paymentSession API call - * - * @param paymentSessionRequest paymentSessionRequest - * @return paymentSessionResponse - * @throws ApiException if it fails to make API call ApiException - */ - public PaymentSetupResponse paymentSession(PaymentSetupRequest paymentSessionRequest) throws ApiException, IOException { - return paymentSession(paymentSessionRequest, null); - } - - /** - * POST /paymentSession API call - * - * @param paymentSessionRequest paymentSessionRequest - * @return paymentSessionResponse - * @throws ApiException if it fails to make API call ApiException - */ - public PaymentSetupResponse paymentSession(PaymentSetupRequest paymentSessionRequest, RequestOptions requestOptions) throws ApiException, IOException { - paymentSessionRequest.setApplicationInfo(setApplicationInfo(paymentSessionRequest.getApplicationInfo())); - String jsonRequest = paymentSessionRequest.toJson(); - String jsonResult = paymentSession.request(jsonRequest, requestOptions); - return PaymentSetupResponse.fromJson(jsonResult); - } - - /** - * POST payments/result API call - * - * @param paymentResultRequest paymentResultRequest - * @return PaymentVerificationResponse - * @throws ApiException if it fails to make API call ApiException - */ - public PaymentVerificationResponse paymentResult(PaymentVerificationRequest paymentResultRequest) throws ApiException, IOException { - return paymentResult(paymentResultRequest, null); - } - - /** - * POST payments/result API call - * - * @param paymentResultRequest paymentResultRequest - * @return PaymentVerificationResponse - * @throws ApiException if it fails to make API call ApiException - */ - public PaymentVerificationResponse paymentResult(PaymentVerificationRequest paymentResultRequest, RequestOptions requestOptions) throws ApiException, IOException { - String jsonRequest = paymentResultRequest.toJson(); - String jsonResult = paymentsResult.request(jsonRequest, requestOptions); - return PaymentVerificationResponse.fromJson(jsonResult); - } - - /** - * POST /orders API call - * - * @param checkoutCreateOrderRequest CheckoutCreateOrderRequest - * @return CheckoutCreateOrderResponse - * @throws ApiException if it fails to make API call - */ - public CheckoutCreateOrderResponse orders(CheckoutCreateOrderRequest checkoutCreateOrderRequest) throws ApiException, IOException { - return orders(checkoutCreateOrderRequest, null); - } - - /** - * POST /orders API call - * - * @param checkoutCreateOrderRequest CheckoutCreateOrderRequest - * @return CheckoutCreateOrderResponse - * @throws ApiException if it fails to make API call - */ - public CheckoutCreateOrderResponse orders(CheckoutCreateOrderRequest checkoutCreateOrderRequest, RequestOptions requestOptions) throws ApiException, IOException { - String jsonRequest = checkoutCreateOrderRequest.toJson(); - String jsonResult = orders.request(jsonRequest, requestOptions); - return CheckoutCreateOrderResponse.fromJson(jsonResult); - } - - /** - * POST /orders/cancel API call - * - * @param checkoutCancelOrderRequest CheckoutCancelOrderRequest - * @return CheckoutCancelOrderResponse - * @throws ApiException if it fails to make API call - */ - public CheckoutCancelOrderResponse ordersCancel(CheckoutCancelOrderRequest checkoutCancelOrderRequest) throws ApiException, IOException { - return ordersCancel(checkoutCancelOrderRequest, null); - } - - /** - * POST /orders/cancel API call - * - * @param checkoutCancelOrderRequest CheckoutCancelOrderRequest - * @return CheckoutCancelOrderResponse - * @throws ApiException if it fails to make API call - */ - public CheckoutCancelOrderResponse ordersCancel(CheckoutCancelOrderRequest checkoutCancelOrderRequest, RequestOptions requestOptions) throws ApiException, IOException { - String jsonRequest = checkoutCancelOrderRequest.toJson(); - String jsonResult = ordersCancel.request(jsonRequest, requestOptions); - return CheckoutCancelOrderResponse.fromJson(jsonResult); - } - - /** - * POST /sessions API call - * - * @param createCheckoutSessionRequest CreateCheckoutSessionRequest - * @return CreateCheckoutSessionResponse - * @throws ApiException if it fails to make API call - */ - public CreateCheckoutSessionResponse sessions(CreateCheckoutSessionRequest createCheckoutSessionRequest) throws ApiException, IOException { - return sessions(createCheckoutSessionRequest, null); - } - - /** - * POST /sessions API call - * - * @param createCheckoutSessionRequest CreateCheckoutSessionRequest - * @return CreateCheckoutSessionResponse - * @throws ApiException if it fails to make API call - */ - public CreateCheckoutSessionResponse sessions(CreateCheckoutSessionRequest createCheckoutSessionRequest, RequestOptions requestOptions) throws ApiException, IOException { - createCheckoutSessionRequest.setApplicationInfo(setApplicationInfo(createCheckoutSessionRequest.getApplicationInfo())); - String jsonRequest = createCheckoutSessionRequest.toJson(); - String jsonResult = sessions.request(jsonRequest, requestOptions); - return CreateCheckoutSessionResponse.fromJson(jsonResult); - } - - /** - * POST /payments/{paymentPspReference}/captures - * - * @param paymentPspReference String - * @param createPaymentCaptureRequest CreatePaymentCaptureRequest - * @return PaymentCaptureResource - * @throws ApiException if it fails to make API call - */ - public PaymentCaptureResource paymentsCaptures(String paymentPspReference, CreatePaymentCaptureRequest createPaymentCaptureRequest) throws ApiException, IOException { - return paymentsCaptures(paymentPspReference, createPaymentCaptureRequest, null); - } - - /** - * POST /payments/{paymentPspReference}/captures - * - * @param paymentPspReference String - * @param createPaymentCaptureRequest CreatePaymentCaptureRequest - * @return PaymentCaptureResource - * @throws ApiException if it fails to make API call - */ - public PaymentCaptureResource paymentsCaptures(String paymentPspReference, CreatePaymentCaptureRequest createPaymentCaptureRequest, RequestOptions requestOptions) throws ApiException, IOException { - CheckoutResource paymentsCaptures = new CheckoutResource(this, "/payments/" + paymentPspReference + "/captures"); - String jsonRequest = createPaymentCaptureRequest.toJson(); - String jsonResult = paymentsCaptures.request(jsonRequest, requestOptions); - return PaymentCaptureResource.fromJson(jsonResult); - } - - /** - * POST /payments/{paymentPspReference}/cancels - * - * @param paymentPspReference String - * @param createPaymentCancelRequest CreatePaymentCancelRequest - * @return PaymentCancelResource - * @throws ApiException if it fails to make API call - */ - public PaymentCancelResource paymentsCancels(String paymentPspReference, CreatePaymentCancelRequest createPaymentCancelRequest) throws ApiException, IOException { - return paymentsCancels(paymentPspReference, createPaymentCancelRequest, null); - } - - /** - * POST /payments/{paymentPspReference}/cancels - * - * @param paymentPspReference String - * @param createPaymentCancelRequest CreatePaymentCancelRequest - * @return PaymentCancelResource - * @throws ApiException if it fails to make API call - */ - public PaymentCancelResource paymentsCancels(String paymentPspReference, CreatePaymentCancelRequest createPaymentCancelRequest, RequestOptions requestOptions) throws ApiException, IOException { - CheckoutResource paymentsCancels = new CheckoutResource(this, "/payments/" + paymentPspReference + "/cancels"); - String jsonRequest = createPaymentCancelRequest.toJson(); - String jsonResult = paymentsCancels.request(jsonRequest, requestOptions); - return PaymentCancelResource.fromJson(jsonResult); - } - - /** - * POST /cancels - * - * @param createStandalonePaymentCancelRequest CreateStandalonePaymentCancelRequest - * @return StandalonePaymentCancelResource - * @throws ApiException if it fails to make API call - */ - public StandalonePaymentCancelResource cancels(CreateStandalonePaymentCancelRequest createStandalonePaymentCancelRequest) throws ApiException, IOException { - return cancels(createStandalonePaymentCancelRequest, null); - } - - /** - * POST /cancels - * - * @param createStandalonePaymentCancelRequest CreateStandalonePaymentCancelRequest - * @return StandalonePaymentCancelResource - * @throws ApiException if it fails to make API call - */ - public StandalonePaymentCancelResource cancels(CreateStandalonePaymentCancelRequest createStandalonePaymentCancelRequest, RequestOptions requestOptions) throws ApiException, IOException { - String jsonRequest = createStandalonePaymentCancelRequest.toJson(); - String jsonResult = cancels.request(jsonRequest, requestOptions); - return StandalonePaymentCancelResource.fromJson(jsonResult); - } - - /** - * POST /payments/{paymentPspReference}/reversal - * - * @param paymentPspReference String - * @param createPaymentReversalRequest CreatePaymentReversalRequest - * @return PaymentReversalResource - * @throws ApiException if it fails to make API call - */ - public PaymentReversalResource paymentsReversals(String paymentPspReference, CreatePaymentReversalRequest createPaymentReversalRequest) throws ApiException, IOException { - return paymentsReversals(paymentPspReference, createPaymentReversalRequest, null); - } - - public PaymentReversalResource paymentsReversals(String paymentPspReference, CreatePaymentReversalRequest createPaymentReversalRequest, RequestOptions requestOptions) throws ApiException, IOException { - CheckoutResource paymentReversal = new CheckoutResource(this, "/payments/" + paymentPspReference + "/reversals"); - String jsonRequest = createPaymentReversalRequest.toJson(); - String jsonResult = paymentReversal.request(jsonRequest, requestOptions); - return PaymentReversalResource.fromJson(jsonResult); - } - - /** - * POST /payments/{paymentPspReference}/refunds - * - * @param paymentPspReference String - * @param createPaymentRefundRequest CreatePaymentRefundRequest - * @return PaymentRefundResource - * @throws ApiException if it fails to make API call - */ - public PaymentRefundResource paymentsRefunds(String paymentPspReference, CreatePaymentRefundRequest createPaymentRefundRequest) throws ApiException, IOException { - return paymentsRefunds(paymentPspReference, createPaymentRefundRequest, null); - } - - public PaymentRefundResource paymentsRefunds(String paymentPspReference, CreatePaymentRefundRequest createPaymentRefundRequest, RequestOptions requestOptions) throws ApiException, IOException { - CheckoutResource paymentsRefunds = new CheckoutResource(this, "/payments/" + paymentPspReference + "/refunds"); - String jsonRequest = createPaymentRefundRequest.toJson(); - String jsonResult = paymentsRefunds.request(jsonRequest, requestOptions); - return PaymentRefundResource.fromJson(jsonResult); - } - - /** - * POST /payments/{paymentPspReference}/amountUpdates - * - * @param paymentPspReference String - * @param createPaymentAmountUpdateRequest CreatePaymentAmountUpdateRequest - * @return PaymentAmountUpdateResource - * @throws ApiException if it fails to make API call - */ - public PaymentAmountUpdateResource paymentsAmountUpdates(String paymentPspReference, CreatePaymentAmountUpdateRequest createPaymentAmountUpdateRequest) throws ApiException, IOException { - return paymentsAmountUpdates(paymentPspReference, createPaymentAmountUpdateRequest, null); - } - - /** - * POST /payments/{paymentPspReference}/amountUpdates - * - * @param paymentPspReference String - * @param createPaymentAmountUpdateRequest CreatePaymentAmountUpdateRequest - * @return PaymentAmountUpdateResource - * @throws ApiException if it fails to make API call - */ - public PaymentAmountUpdateResource paymentsAmountUpdates(String paymentPspReference, CreatePaymentAmountUpdateRequest createPaymentAmountUpdateRequest, RequestOptions requestOptions) throws ApiException, IOException { - CheckoutResource paymentsAmountUpdates = new CheckoutResource(this, "/payments/" + paymentPspReference + "/amountUpdates"); - String jsonRequest = createPaymentAmountUpdateRequest.toJson(); - String jsonResult = paymentsAmountUpdates.request(jsonRequest, requestOptions); - return PaymentAmountUpdateResource.fromJson(jsonResult); - } - - /** - * POST /paymentMethods/balance - * - * @param checkoutBalanceCheckRequest CheckoutBalanceCheckRequest - * @return CheckoutBalanceCheckResponse - * @throws ApiException if it fails to make API call - */ - public CheckoutBalanceCheckResponse paymentsMethodsBalance(CheckoutBalanceCheckRequest checkoutBalanceCheckRequest) throws ApiException, IOException { - String jsonRequest = checkoutBalanceCheckRequest.toJson(); - String jsonResult = paymentMethodsBalance.request(jsonRequest); - return CheckoutBalanceCheckResponse.fromJson(jsonResult); - } - - /** - * POST /paymentLinks - * - * @param createPaymentLinkRequest CreatePaymentLinkRequest - * @return PaymentLinkResponse - * @throws ApiException if it fails to make API call - */ - public PaymentLinkResponse paymentLinks(CreatePaymentLinkRequest createPaymentLinkRequest) throws ApiException, IOException { - return paymentLinks(createPaymentLinkRequest, null); - } - - /** - * POST /paymentLinks - * - * @param createPaymentLinkRequest CreatePaymentLinkRequest - * @return PaymentLinkResponse - * @throws ApiException if it fails to make API call - */ - public PaymentLinkResponse paymentLinks(CreatePaymentLinkRequest createPaymentLinkRequest, RequestOptions requestOptions) throws ApiException, IOException { - String jsonRequest = createPaymentLinkRequest.toJson(); - String jsonResult = paymentLinks.request(jsonRequest, requestOptions); - return PaymentLinkResponse.fromJson(jsonResult); - } - - /** - * GET /paymentLinks/{linkId} - * - * @param linkId String - * @return PaymentLinkResponse - * @throws ApiException if it fails to make API call - */ - public PaymentLinkResponse getPaymentLinks(String linkId) throws ApiException, IOException { - CheckoutResource paymentLinks = new CheckoutResource(this, "/paymentLinks/" + linkId); - String jsonResult = paymentLinks.request("{}", GET); - return PaymentLinkResponse.fromJson(jsonResult); - } - - /** - * PATCH /paymentLinks/{linkId} - * - * @param updatePaymentLinkRequest UpdatePaymentLinkRequest - * @param linkId String - * @return PaymentLinkResponse - * @throws ApiException if it fails to make API call - */ - public PaymentLinkResponse patchPaymentLinks(String linkId, UpdatePaymentLinkRequest updatePaymentLinkRequest) throws ApiException, IOException { - CheckoutResource paymentLinks = new CheckoutResource(this, "/paymentLinks/" + linkId); - String jsonRequest = updatePaymentLinkRequest.toJson(); - String jsonResult = paymentLinks.request(jsonRequest, PATCH); - return PaymentLinkResponse.fromJson(jsonResult); - } - - /** - * POST /applePay/sessions - * - * @param createApplePaySessionRequest CreateApplePaySessionRequest - * @return ApplePaySessionResponse - * @throws ApiException if it fails to make API call - */ - public ApplePaySessionResponse applePaySessions(CreateApplePaySessionRequest createApplePaySessionRequest) throws ApiException, IOException { - return applePaySessions(createApplePaySessionRequest, null); - } - - /** - * POST /applePay/sessions - * - * @param createApplePaySessionRequest CreateApplePaySessionRequest - * @return ApplePaySessionResponse - * @throws ApiException if it fails to make API call - */ - public ApplePaySessionResponse applePaySessions(CreateApplePaySessionRequest createApplePaySessionRequest, RequestOptions requestOptions) throws ApiException, IOException { - String jsonRequest = createApplePaySessionRequest.toJson(); - String jsonResult = applePaySessions.request(jsonRequest, requestOptions); - return ApplePaySessionResponse.fromJson(jsonResult); - } - - /** - * POST /donations - * - * @param paymentDonationRequest PaymentDonationRequest - * @return DonationResponse - * @throws ApiException if it fails to make API call - */ - public DonationResponse donations(PaymentDonationRequest paymentDonationRequest) throws ApiException, IOException { - return donations(paymentDonationRequest, null); - } - - /** - * POST /donations - * - * @param paymentDonationRequest PaymentDonationRequest - * @return DonationResponse - * @throws ApiException if it fails to make API call - */ - public DonationResponse donations(PaymentDonationRequest paymentDonationRequest, RequestOptions requestOptions) throws ApiException, IOException { - paymentDonationRequest.setApplicationInfo(setApplicationInfo(paymentDonationRequest.getApplicationInfo())); - String jsonRequest = paymentDonationRequest.toJson(); - String jsonResult = donations.request(jsonRequest, requestOptions); - return DonationResponse.fromJson(jsonResult); - } - - /** - * POST /cardDetails - * - * @param cardDetailsRequest CardDetailsRequest - * @return CardDetailsResponse - * @throws ApiException if it fails to make API call - */ - public CardDetailsResponse cardDetails(CardDetailsRequest cardDetailsRequest) throws ApiException, IOException { - return cardDetails(cardDetailsRequest, null); - } - - /** - * POST /cardDetails - * - * @param cardDetailsRequest CardDetailsRequest - * @return CardDetailsResponse - * @throws ApiException if it fails to make API call - */ - public CardDetailsResponse cardDetails(CardDetailsRequest cardDetailsRequest, RequestOptions requestOptions) throws ApiException, IOException { - String jsonRequest = cardDetailsRequest.toJson(); - String jsonResult = cardDetails.request(jsonRequest, requestOptions); - return CardDetailsResponse.fromJson(jsonResult); - } - - /** - * GET /storedPaymentMethods - * - * @return ListStoredPaymentMethodsResponse - * @throws ApiException if it fails to make API call - */ - public ListStoredPaymentMethodsResponse getStoredPaymentDetails() throws ApiException, IOException { - return getStoredPaymentDetails(null); - } - - /** - * GET /storedPaymentMethods - * - * @param queryParams (optional) - * merchantAccount: Your merchant account. (optional) - * shopperReference: Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. (optional) - * @return ListStoredPaymentMethodsResponse - * @throws ApiException if it fails to make API call - */ - public ListStoredPaymentMethodsResponse getStoredPaymentDetails(Map queryParams) throws ApiException, IOException { - String jsonResult = storedPaymentMethods.request("{}", null, GET, null, queryParams); - return ListStoredPaymentMethodsResponse.fromJson(jsonResult); - } - - /** - * DELETE /storedPaymentMethods/{recurringId} - * - * @param recurringId String - * @throws ApiException if it fails to make API call - */ - public void deleteStoredPaymentDetails(String recurringId) throws ApiException, IOException { - deleteStoredPaymentDetails(recurringId, null); - } - - /** - * DELETE /storedPaymentMethods/{recurringId} - * - * @param recurringId String - * @param queryParams (optional) - * merchantAccount: Your merchant account. (optional) - * shopperReference: Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. (optional) - * @throws ApiException if it fails to make API call - */ - public void deleteStoredPaymentDetails(String recurringId, Map queryParams) throws ApiException, IOException { - CheckoutResource checkoutResource = new CheckoutResource(this, "/storedPaymentMethods/" + recurringId); - checkoutResource.request("{}", null, DELETE, null, queryParams); - } -} diff --git a/src/test/java/com/adyen/CheckoutTest.java b/src/test/java/com/adyen/CheckoutTest.java index bf08d76b8..452492b85 100644 --- a/src/test/java/com/adyen/CheckoutTest.java +++ b/src/test/java/com/adyen/CheckoutTest.java @@ -72,7 +72,7 @@ public void TestPaymentSuccess() throws Exception { cardDetails.setType(CardDetails.TypeEnum.SCHEME); PaymentRequest paymentRequest = new PaymentRequest(); paymentRequest.setAmount(amount); - paymentRequest.setPaymentMethod(new PaymentDonationRequestPaymentMethod(cardDetails)); + paymentRequest.setPaymentMethod(new CheckoutPaymentMethod(cardDetails)); PaymentsApi checkout = new PaymentsApi(client); PaymentResponse paymentResponse = checkout.payments(paymentRequest); assertEquals("993617895204576J", paymentResponse.getPspReference()); @@ -94,7 +94,7 @@ public void TestPaymentRequestSerialization() throws Exception { paymentRequest.setMerchantAccount("myMerchantAccount"); paymentRequest.setReference("merchantReference"); paymentRequest.setReturnUrl("http://return.com"); - paymentRequest.setPaymentMethod(new PaymentDonationRequestPaymentMethod(idealDetails)); + paymentRequest.setPaymentMethod(new CheckoutPaymentMethod(idealDetails)); PaymentRequest parsedPaymentRequest = PaymentRequest.fromJson(paymentRequestJson); assertEquals(IdealDetails.TypeEnum.IDEAL, parsedPaymentRequest.getPaymentMethod().getIdealDetails().getType()); @@ -292,7 +292,7 @@ public void TestDonationsSuccessCall() throws Exception { paymentDonationRequest.setDonationAccount("YOUR_DONATION_ACCOUNT"); paymentDonationRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT"); CardDetails cardDetails = new CardDetails().type(CardDetails.TypeEnum.SCHEME); - paymentDonationRequest.paymentMethod(new PaymentDonationRequestPaymentMethod(cardDetails)); + paymentDonationRequest.paymentMethod(new CheckoutPaymentMethod(cardDetails)); paymentDonationRequest.setReference("YOUR_MERCHANT_REFERENCE"); paymentDonationRequest.setReturnUrl("https://your-company.com/..."); PaymentsApi checkout = new PaymentsApi(client); diff --git a/src/test/java/com/adyen/DateSerializationTest.java b/src/test/java/com/adyen/DateSerializationTest.java index 368f1f129..3d5f00dce 100644 --- a/src/test/java/com/adyen/DateSerializationTest.java +++ b/src/test/java/com/adyen/DateSerializationTest.java @@ -6,7 +6,9 @@ import com.adyen.model.checkout.CreatePaymentLinkRequest; import com.adyen.model.checkout.PaymentSetupRequest; import com.adyen.model.checkout.PaymentRequest; -import com.adyen.service.Checkout; +import com.adyen.service.checkout.ClassicCheckoutSdkApi; +import com.adyen.service.checkout.PaymentLinksApi; +import com.adyen.service.checkout.PaymentsApi; import com.adyen.service.exception.ApiException; import org.junit.Test; import org.mockito.Mockito; @@ -31,7 +33,7 @@ private OffsetDateTime date() { @Test public void TestCheckoutSessionDate() throws IOException, ApiException, HTTPClientException { Client client = createMockClientFromFile("mocks/checkout/createSessionsResponse.json"); - Checkout checkout = new Checkout(client); + PaymentsApi checkout = new PaymentsApi(client); CreateCheckoutSessionRequest sessionsRequest = new CreateCheckoutSessionRequest(); @@ -41,13 +43,13 @@ public void TestCheckoutSessionDate() throws IOException, ApiException, HTTPClie ClientInterface http = client.getHttpClient(); String expected = "\"deliverAt\":\"2023-06-02T12:00:00"; - verify(http).request(anyString(), Mockito.contains(expected), any(), eq(true), isNull(), any(), isNull()); + verify(http).request(anyString(), Mockito.contains(expected), any(), eq(false), isNull(), any(), isNull()); } @Test public void TestCreatePaymentLinkDate() throws IOException, ApiException, HTTPClientException { Client client = createMockClientFromFile("mocks/checkout/paymentLinkResponse.json"); - Checkout checkout = new Checkout(client); + PaymentLinksApi checkout = new PaymentLinksApi(client); CreatePaymentLinkRequest paymentLinkRequest = new CreatePaymentLinkRequest(); @@ -59,14 +61,14 @@ public void TestCreatePaymentLinkDate() throws IOException, ApiException, HTTPCl String expected1 = "\"deliverAt\":\"2023-06-02T12:00:00"; String expected2 = "\"dateOfBirth\":\"2023-06-02"; - verify(http).request(anyString(), Mockito.contains(expected1), any(), eq(true), isNull(), any(), isNull()); - verify(http).request(anyString(), Mockito.contains(expected2), any(), eq(true), isNull(), any(), isNull()); + verify(http).request(anyString(), Mockito.contains(expected1), any(), eq(false), isNull(), any(), isNull()); + verify(http).request(anyString(), Mockito.contains(expected2), any(), eq(false), isNull(), any(), isNull()); } @Test public void TestPaymentSessionDate() throws IOException, ApiException, HTTPClientException { Client client = createMockClientFromFile("mocks/checkout/paymentSessionResponse.json"); - Checkout checkout = new Checkout(client); + ClassicCheckoutSdkApi checkout = new ClassicCheckoutSdkApi(client); PaymentSetupRequest request = new PaymentSetupRequest(); @@ -78,14 +80,14 @@ public void TestPaymentSessionDate() throws IOException, ApiException, HTTPClien String expected1 = "\"deliveryDate\":\"2023-06-02T12:00:00"; String expected2 = "\"dateOfBirth\":\"2023-06-02"; - verify(http).request(anyString(), Mockito.contains(expected1), any(), eq(true), isNull(), any(), isNull()); - verify(http).request(anyString(), Mockito.contains(expected2), any(), eq(true), isNull(), any(), isNull()); + verify(http).request(anyString(), Mockito.contains(expected1), any(), eq(false), isNull(), any(), isNull()); + verify(http).request(anyString(), Mockito.contains(expected2), any(), eq(false), isNull(), any(), isNull()); } @Test public void TestCheckoutPaymentsDate() throws IOException, ApiException, HTTPClientException { Client client = createMockClientFromFile("mocks/checkout/paymentResponse.json"); - Checkout checkout = new Checkout(client); + PaymentsApi checkout = new PaymentsApi(client); PaymentRequest request = new PaymentRequest(); @@ -97,7 +99,7 @@ public void TestCheckoutPaymentsDate() throws IOException, ApiException, HTTPCli String expected1 = "\"deliveryDate\":\"2023-06-02T12:00:00"; String expected2 = "\"dateOfBirth\":\"2023-06-02"; - verify(http).request(anyString(), Mockito.contains(expected1), any(), eq(true), isNull(), any(), isNull()); - verify(http).request(anyString(), Mockito.contains(expected2), any(), eq(true), isNull(), any(), isNull()); + verify(http).request(anyString(), Mockito.contains(expected1), any(), eq(false), isNull(), any(), isNull()); + verify(http).request(anyString(), Mockito.contains(expected2), any(), eq(false), isNull(), any(), isNull()); } } diff --git a/src/test/java/com/adyen/ErrorHandlingTest.java b/src/test/java/com/adyen/ErrorHandlingTest.java index 6e8289fb5..f8087348d 100644 --- a/src/test/java/com/adyen/ErrorHandlingTest.java +++ b/src/test/java/com/adyen/ErrorHandlingTest.java @@ -1,13 +1,8 @@ package com.adyen; import com.adyen.enums.Environment; -import com.adyen.model.checkout.PaymentLinkResponse; -import com.adyen.model.checkout.ServiceError; -import com.adyen.model.management.AllowedOriginsResponse; import com.adyen.model.management.CreateAllowedOriginRequest; -import com.adyen.model.management.JSON; -import com.adyen.model.management.RestServiceError; -import com.adyen.service.Checkout; +import com.adyen.service.checkout.PaymentLinksApi; import com.adyen.service.exception.ApiException; import com.adyen.service.management.MyApiCredential; import org.junit.Assert; @@ -37,10 +32,10 @@ public void addAllowedOriginFail() throws IOException, ApiException { @Ignore("Integration test") public void CheckoutErrorTest() throws IOException, ApiException { Client client = new Client(System.getenv("API_KEY"), Environment.TEST); - Checkout service = new Checkout(client); + PaymentLinksApi service = new PaymentLinksApi(client); try { - service.getPaymentLinks("1234"); + service.getPaymentLink("1234"); } catch(ApiException e) { Assert.assertTrue(e.getResponseBody().contains("Invalid payment link ID")); } From ec9396462175e8950ade7ff7faeba67bebaccc37 Mon Sep 17 00:00:00 2001 From: Michael Paul Date: Mon, 24 Apr 2023 11:30:45 +0200 Subject: [PATCH 16/32] ITT-485: Upgrade LEM to v3 (#1003) * ITT-485: Upgrade models * ITT-485: Remove old fixtures * ITT-485: Redundant semicolon * ITT-485: Upgrade service classes Except for DocumentsApi. * ITT-485: Unused imports --- Makefile | 2 +- README.md | 2 +- src/main/java/com/adyen/Client.java | 2 +- .../AULocalAccountIdentification.java | 332 +++++++ .../AbstractOpenApiSchema.java | 2 +- .../AcceptTermsOfServiceRequest.java | 2 +- .../AcceptTermsOfServiceResponse.java | 2 +- .../AdditionalBankIdentification.java | 291 +++++++ .../model/legalentitymanagement/Address.java | 2 +- .../model/legalentitymanagement/Amount.java | 2 +- .../legalentitymanagement/Attachment.java | 2 +- .../BankAccountInfo.java | 315 +------ .../BankAccountInfoAccountIdentification.java | 816 ++++++++++++++++++ .../legalentitymanagement/BirthData.java | 2 +- .../legalentitymanagement/BusinessLine.java | 153 +++- .../BusinessLineInfo.java | 103 ++- .../BusinessLineInfoUpdate.java | 107 ++- .../legalentitymanagement/BusinessLines.java | 2 +- .../CALocalAccountIdentification.java | 449 ++++++++++ .../CZLocalAccountIdentification.java | 332 +++++++ ...CalculateTermsOfServiceStatusResponse.java | 275 ------ .../CapabilityProblem.java | 2 +- .../CapabilityProblemEntity.java | 2 +- .../CapabilityProblemEntityRecursive.java | 2 +- .../CapabilitySettings.java | 2 +- .../DKLocalAccountIdentification.java | 332 +++++++ .../model/legalentitymanagement/Document.java | 2 +- .../DocumentReference.java | 2 +- .../EntityReference.java | 2 +- .../GeneratePciDescriptionRequest.java | 208 +++++ .../GeneratePciDescriptionResponse.java | 280 ++++++ .../GetPciQuestionnaireInfosResponse.java | 227 +++++ .../GetPciQuestionnaireResponse.java | 296 +++++++ ...TermsOfServiceAcceptanceInfosResponse.java | 2 +- .../GetTermsOfServiceDocumentRequest.java | 2 +- .../GetTermsOfServiceDocumentResponse.java | 2 +- .../HULocalAccountIdentification.java | 298 +++++++ .../IbanAccountIdentification.java | 298 +++++++ .../IdentificationData.java | 2 +- .../legalentitymanagement/Individual.java | 2 +- .../model/legalentitymanagement/JSON.java | 25 +- .../legalentitymanagement/LegalEntity.java | 54 +- .../LegalEntityAssociation.java | 2 +- .../LegalEntityCapability.java | 39 +- .../LegalEntityInfo.java | 2 +- .../LegalEntityInfoRequiredType.java | 2 +- .../NOLocalAccountIdentification.java | 298 +++++++ .../model/legalentitymanagement/Name.java | 2 +- .../NumberAndBicAccountIdentification.java | 366 ++++++++ .../legalentitymanagement/OnboardingLink.java | 2 +- .../OnboardingLinkInfo.java | 2 +- .../OnboardingTheme.java | 2 +- .../OnboardingThemes.java | 2 +- .../legalentitymanagement/Organization.java | 2 +- .../legalentitymanagement/OwnerEntity.java | 2 +- .../PLLocalAccountIdentification.java | 298 +++++++ .../PciDocumentInfo.java | 267 ++++++ .../PciSigningRequest.java | 257 ++++++ .../PciSigningResponse.java | 251 ++++++ .../legalentitymanagement/PhoneNumber.java | 2 +- .../RemediatingAction.java | 2 +- .../SELocalAccountIdentification.java | 332 +++++++ .../legalentitymanagement/ServiceError.java | 2 +- .../SoleProprietorship.java | 2 +- .../legalentitymanagement/SourceOfFunds.java | 4 +- .../legalentitymanagement/StockData.java | 2 +- .../SupportingEntityCapability.java | 2 +- .../legalentitymanagement/TaxInformation.java | 2 +- .../TaxReportingClassification.java | 2 +- .../TermsOfServiceAcceptanceInfo.java | 2 +- .../TransferInstrument.java | 94 +- .../TransferInstrumentInfo.java | 2 +- .../TransferInstrumentReference.java | 2 +- .../UKLocalAccountIdentification.java | 332 +++++++ .../USLocalAccountIdentification.java | 415 +++++++++ .../VerificationError.java | 2 +- .../VerificationErrorRecursive.java | 2 +- .../VerificationErrors.java | 227 +++++ .../model/legalentitymanagement/WebData.java | 2 +- .../WebDataExemption.java | 2 +- .../BusinessLineService.java | 3 + .../BusinessLinesApi.java | 160 ++++ .../legalentitymanagement/Documents.java | 3 + .../HostedOnboarding.java | 3 + .../HostedOnboardingApi.java | 129 +++ .../legalentitymanagement/LegalEntities.java | 3 + .../LegalEntitiesApi.java | 198 +++++ .../PciQuestionnairesApi.java | 180 ++++ .../TermsOfServiceApi.java | 146 ++++ .../TransferInstruments.java | 3 + .../TransferInstrumentsApi.java | 159 ++++ .../com/adyen/LegalEntityManagementTest.java | 194 ++--- .../legalentitymanagement/BusinessLine.json | 16 - .../legalentitymanagement/BusinessLines.json | 17 - .../request/BusinessLineInfo.json | 21 + .../request/BusinessLineInfoUpdate.json | 21 + .../LegalEntityInfoRequiredType.json} | 66 +- .../request/TransferInstrumentInfo.json | 12 + .../response/BusinessLine.json | 73 ++ .../response/BusinessLines.json | 77 ++ .../response/LegalEntity.json | 399 +++++++++ .../response/TransferInstrument.json | 93 ++ templates/libraries/okhttp-gson/pojo.mustache | 2 +- 103 files changed, 9567 insertions(+), 878 deletions(-) create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/AdditionalBankIdentification.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfoAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java delete mode 100644 src/main/java/com/adyen/model/legalentitymanagement/CalculateTermsOfServiceStatusResponse.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/HULocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/NumberAndBicAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java create mode 100644 src/main/java/com/adyen/service/legalentitymanagement/BusinessLinesApi.java create mode 100644 src/main/java/com/adyen/service/legalentitymanagement/HostedOnboardingApi.java create mode 100644 src/main/java/com/adyen/service/legalentitymanagement/LegalEntitiesApi.java create mode 100644 src/main/java/com/adyen/service/legalentitymanagement/PciQuestionnairesApi.java create mode 100644 src/main/java/com/adyen/service/legalentitymanagement/TermsOfServiceApi.java create mode 100644 src/main/java/com/adyen/service/legalentitymanagement/TransferInstrumentsApi.java delete mode 100644 src/test/resources/mocks/legalentitymanagement/BusinessLine.json delete mode 100644 src/test/resources/mocks/legalentitymanagement/BusinessLines.json create mode 100644 src/test/resources/mocks/legalentitymanagement/request/BusinessLineInfo.json create mode 100644 src/test/resources/mocks/legalentitymanagement/request/BusinessLineInfoUpdate.json rename src/test/resources/mocks/legalentitymanagement/{LegalEntity.json => request/LegalEntityInfoRequiredType.json} (72%) create mode 100644 src/test/resources/mocks/legalentitymanagement/request/TransferInstrumentInfo.json create mode 100644 src/test/resources/mocks/legalentitymanagement/response/BusinessLine.json create mode 100644 src/test/resources/mocks/legalentitymanagement/response/BusinessLines.json create mode 100644 src/test/resources/mocks/legalentitymanagement/response/LegalEntity.json create mode 100644 src/test/resources/mocks/legalentitymanagement/response/TransferInstrument.json diff --git a/Makefile b/Makefile index ff0b181aa..d08677101 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ payout: spec=PayoutService-v68 management: spec=ManagementService-v1 balanceplatform: spec=BalancePlatformService-v2 transfers: spec=TransferService-v3 -legalentitymanagement: spec=LegalEntityService-v2 +legalentitymanagement: spec=LegalEntityService-v3 # Classic Platforms marketpay/account: spec=AccountService-v6 marketpay/fund: spec=FundService-v6 diff --git a/README.md b/README.md index ed9264c38..c93e75b96 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The Library supports all APIs under the following services: | [Checkout API](https://docs.adyen.com/api-explorer/#/CheckoutService/v69/overview) | Our latest integration for accepting online payments. | Checkout | **v69** | | [Configuration API](https://docs.adyen.com/api-explorer/#/balanceplatform/v2/overview) | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | balanceplatform package subclasses | **v2** | | [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) | Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email) | DataProtection | **v1** | -| [Legal Entity Management API](https://docs.adyen.com/api-explorer/#/legalentity/v2/overview) | Manage legal entities that contain information required for verification. | legalentitymanagement package subclasses | **v2** | +| [Legal Entity Management API](https://docs.adyen.com/api-explorer/#/legalentity/v2/overview) | Manage legal entities that contain information required for verification. | legalentitymanagement package subclasses | **v3** | | [Local/Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/terminal-api-reference) | Our point-of-sale integration. | TerminalLocalAPI or TerminalCloudAPI | - | | [Management API](https://docs.adyen.com/api-explorer/#/ManagementService/v1/overview) | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | management package subclasses | **v1** | | [Payments API](https://docs.adyen.com/api-explorer/#/Payment/v68/overview) | Our classic integration for online payments. | Payment | **v68** | diff --git a/src/main/java/com/adyen/Client.java b/src/main/java/com/adyen/Client.java index 9c441cf11..ff4bcd57c 100644 --- a/src/main/java/com/adyen/Client.java +++ b/src/main/java/com/adyen/Client.java @@ -70,7 +70,7 @@ public class Client { public static final String TRANSFER_VERSION = "v3"; public static final String LEGAL_ENTITY_MANAGEMENT_ENDPOINT_TEST = "https://kyc-test.adyen.com/lem/"; public static final String LEGAL_ENTITY_MANAGEMENT_ENDPOINT_LIVE = "https://kyc-test.adyen.com/lem/"; - public static final String LEGAL_ENTITY_MANAGEMENT_VERSION = "v2"; + public static final String LEGAL_ENTITY_MANAGEMENT_VERSION = "v3"; public static final String MANAGEMENT_ENDPOINT_TEST = "https://management-test.adyen.com/"; public static final String MANAGEMENT_ENDPOINT_LIVE = "https://management-live.adyen.com/"; public static final String MANAGEMENT_VERSION = "v1"; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java new file mode 100644 index 000000000..b53b588ef --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java @@ -0,0 +1,332 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * AULocalAccountIdentification + */ + +public class AULocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_BSB_CODE = "bsbCode"; + @SerializedName(SERIALIZED_NAME_BSB_CODE) + private String bsbCode; + + /** + * **auLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + AULOCAL("auLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.AULOCAL; + + public AULocalAccountIdentification() { + } + + public AULocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The bank account number, without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The bank account number, without separators or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public AULocalAccountIdentification bsbCode(String bsbCode) { + + this.bsbCode = bsbCode; + return this; + } + + /** + * The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace. + * @return bsbCode + **/ + @ApiModelProperty(required = true, value = "The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace.") + + public String getBsbCode() { + return bsbCode; + } + + + public void setBsbCode(String bsbCode) { + this.bsbCode = bsbCode; + } + + + public AULocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **auLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**auLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AULocalAccountIdentification auLocalAccountIdentification = (AULocalAccountIdentification) o; + return Objects.equals(this.accountNumber, auLocalAccountIdentification.accountNumber) && + Objects.equals(this.bsbCode, auLocalAccountIdentification.bsbCode) && + Objects.equals(this.type, auLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, bsbCode, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AULocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" bsbCode: ").append(toIndentedString(bsbCode)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("bsbCode"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("bsbCode"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AULocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AULocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AULocalAccountIdentification is not found in the empty JSON string", AULocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AULocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AULocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AULocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // validate the optional field bsbCode + if (jsonObj.get("bsbCode") != null && !jsonObj.get("bsbCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bsbCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bsbCode").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AULocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AULocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AULocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AULocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AULocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AULocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of AULocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to AULocalAccountIdentification + */ + public static AULocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AULocalAccountIdentification.class); + } + + /** + * Convert an instance of AULocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/legalentitymanagement/AbstractOpenApiSchema.java index d67b305e3..40644ee1f 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AbstractOpenApiSchema.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java index 78593f7a8..5635acb0f 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java index b7cbf98ec..d69db8764 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/AdditionalBankIdentification.java new file mode 100644 index 000000000..5cdb54bdb --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/AdditionalBankIdentification.java @@ -0,0 +1,291 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * AdditionalBankIdentification + */ + +public class AdditionalBankIdentification { + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + private String code; + + /** + * The type of additional bank identification, depending on the country. Possible values: * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + GBSORTCODE("gbSortCode"), + + USROUTINGNUMBER("usRoutingNumber"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public AdditionalBankIdentification() { + } + + public AdditionalBankIdentification code(String code) { + + this.code = code; + return this; + } + + /** + * The value of the additional bank identification. + * @return code + **/ + @ApiModelProperty(value = "The value of the additional bank identification.") + + public String getCode() { + return code; + } + + + public void setCode(String code) { + this.code = code; + } + + + public AdditionalBankIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of additional bank identification, depending on the country. Possible values: * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces. + * @return type + **/ + @ApiModelProperty(value = "The type of additional bank identification, depending on the country. Possible values: * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalBankIdentification additionalBankIdentification = (AdditionalBankIdentification) o; + return Objects.equals(this.code, additionalBankIdentification.code) && + Objects.equals(this.type, additionalBankIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(code, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalBankIdentification {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("code"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalBankIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalBankIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalBankIdentification is not found in the empty JSON string", AdditionalBankIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalBankIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalBankIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field code + if (jsonObj.get("code") != null && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AdditionalBankIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AdditionalBankIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AdditionalBankIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AdditionalBankIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AdditionalBankIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AdditionalBankIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalBankIdentification + * @throws IOException if the JSON string is invalid with respect to AdditionalBankIdentification + */ + public static AdditionalBankIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalBankIdentification.class); + } + + /** + * Convert an instance of AdditionalBankIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Address.java b/src/main/java/com/adyen/model/legalentitymanagement/Address.java index 78739e1a4..e01364a9f 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Address.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Address.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Amount.java b/src/main/java/com/adyen/model/legalentitymanagement/Amount.java index 04e8bd6ab..7e0e39a5c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Amount.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Amount.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java b/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java index b2442a856..b907e9ace 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java index 812a72063..645d432c1 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.adyen.model.legalentitymanagement.BankAccountInfoAccountIdentification; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -48,72 +49,40 @@ */ public class BankAccountInfo { - public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; - @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) - private String accountNumber; + public static final String SERIALIZED_NAME_ACCOUNT_IDENTIFICATION = "accountIdentification"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_IDENTIFICATION) + private BankAccountInfoAccountIdentification accountIdentification; public static final String SERIALIZED_NAME_ACCOUNT_TYPE = "accountType"; @SerializedName(SERIALIZED_NAME_ACCOUNT_TYPE) private String accountType; - public static final String SERIALIZED_NAME_BANK_BIC_SWIFT = "bankBicSwift"; - @SerializedName(SERIALIZED_NAME_BANK_BIC_SWIFT) - private String bankBicSwift; - - public static final String SERIALIZED_NAME_BANK_CITY = "bankCity"; - @SerializedName(SERIALIZED_NAME_BANK_CITY) - private String bankCity; - - public static final String SERIALIZED_NAME_BANK_CODE = "bankCode"; - @SerializedName(SERIALIZED_NAME_BANK_CODE) - private String bankCode; - - public static final String SERIALIZED_NAME_BANK_NAME = "bankName"; - @SerializedName(SERIALIZED_NAME_BANK_NAME) - private String bankName; - - public static final String SERIALIZED_NAME_BRANCH_CODE = "branchCode"; - @SerializedName(SERIALIZED_NAME_BRANCH_CODE) - private String branchCode; - - public static final String SERIALIZED_NAME_CHECK_CODE = "checkCode"; - @SerializedName(SERIALIZED_NAME_CHECK_CODE) - private String checkCode; - public static final String SERIALIZED_NAME_COUNTRY_CODE = "countryCode"; @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) private String countryCode; - public static final String SERIALIZED_NAME_CURRENCY_CODE = "currencyCode"; - @SerializedName(SERIALIZED_NAME_CURRENCY_CODE) - private String currencyCode; - - public static final String SERIALIZED_NAME_IBAN = "iban"; - @SerializedName(SERIALIZED_NAME_IBAN) - private String iban; - public BankAccountInfo() { } - public BankAccountInfo accountNumber(String accountNumber) { + public BankAccountInfo accountIdentification(BankAccountInfoAccountIdentification accountIdentification) { - this.accountNumber = accountNumber; + this.accountIdentification = accountIdentification; return this; } /** - * The bank account number (without separators). When this is provided, the `branchCode` is also required. - * @return accountNumber + * Get accountIdentification + * @return accountIdentification **/ - @ApiModelProperty(value = "The bank account number (without separators). When this is provided, the `branchCode` is also required.") + @ApiModelProperty(value = "") - public String getAccountNumber() { - return accountNumber; + public BankAccountInfoAccountIdentification getAccountIdentification() { + return accountIdentification; } - public void setAccountNumber(String accountNumber) { - this.accountNumber = accountNumber; + public void setAccountIdentification(BankAccountInfoAccountIdentification accountIdentification) { + this.accountIdentification = accountIdentification; } @@ -141,138 +110,6 @@ public void setAccountType(String accountType) { } - public BankAccountInfo bankBicSwift(String bankBicSwift) { - - this.bankBicSwift = bankBicSwift; - return this; - } - - /** - * The bank's BIC or SWIFT code. - * @return bankBicSwift - **/ - @ApiModelProperty(value = "The bank's BIC or SWIFT code.") - - public String getBankBicSwift() { - return bankBicSwift; - } - - - public void setBankBicSwift(String bankBicSwift) { - this.bankBicSwift = bankBicSwift; - } - - - public BankAccountInfo bankCity(String bankCity) { - - this.bankCity = bankCity; - return this; - } - - /** - * The city where the bank is located. - * @return bankCity - **/ - @ApiModelProperty(value = "The city where the bank is located.") - - public String getBankCity() { - return bankCity; - } - - - public void setBankCity(String bankCity) { - this.bankCity = bankCity; - } - - - public BankAccountInfo bankCode(String bankCode) { - - this.bankCode = bankCode; - return this; - } - - /** - * The bank code of the banking institution with which the bank account is registered. - * @return bankCode - **/ - @ApiModelProperty(value = "The bank code of the banking institution with which the bank account is registered.") - - public String getBankCode() { - return bankCode; - } - - - public void setBankCode(String bankCode) { - this.bankCode = bankCode; - } - - - public BankAccountInfo bankName(String bankName) { - - this.bankName = bankName; - return this; - } - - /** - * The name of the banking institution where the bank account is held. - * @return bankName - **/ - @ApiModelProperty(value = "The name of the banking institution where the bank account is held.") - - public String getBankName() { - return bankName; - } - - - public void setBankName(String bankName) { - this.bankName = bankName; - } - - - public BankAccountInfo branchCode(String branchCode) { - - this.branchCode = branchCode; - return this; - } - - /** - * The branch code of the branch under which the bank account is registered. Required when you provide an `accountNumber`. In the following countries, this value corresponds to: * United States: routing number * United Kingdom: sort code * Germany: Bankleitzahl - * @return branchCode - **/ - @ApiModelProperty(value = "The branch code of the branch under which the bank account is registered. Required when you provide an `accountNumber`. In the following countries, this value corresponds to: * United States: routing number * United Kingdom: sort code * Germany: Bankleitzahl") - - public String getBranchCode() { - return branchCode; - } - - - public void setBranchCode(String branchCode) { - this.branchCode = branchCode; - } - - - public BankAccountInfo checkCode(String checkCode) { - - this.checkCode = checkCode; - return this; - } - - /** - * The check code of the bank account. - * @return checkCode - **/ - @ApiModelProperty(value = "The check code of the bank account.") - - public String getCheckCode() { - return checkCode; - } - - - public void setCheckCode(String checkCode) { - this.checkCode = checkCode; - } - - public BankAccountInfo countryCode(String countryCode) { this.countryCode = countryCode; @@ -295,50 +132,6 @@ public void setCountryCode(String countryCode) { } - public BankAccountInfo currencyCode(String currencyCode) { - - this.currencyCode = currencyCode; - return this; - } - - /** - * The account's three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). For example, **EUR**. - * @return currencyCode - **/ - @ApiModelProperty(required = true, value = "The account's three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). For example, **EUR**.") - - public String getCurrencyCode() { - return currencyCode; - } - - - public void setCurrencyCode(String currencyCode) { - this.currencyCode = currencyCode; - } - - - public BankAccountInfo iban(String iban) { - - this.iban = iban; - return this; - } - - /** - * The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. - * @return iban - **/ - @ApiModelProperty(value = "The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard.") - - public String getIban() { - return iban; - } - - - public void setIban(String iban) { - this.iban = iban; - } - - @Override public boolean equals(Object o) { @@ -349,39 +142,23 @@ public boolean equals(Object o) { return false; } BankAccountInfo bankAccountInfo = (BankAccountInfo) o; - return Objects.equals(this.accountNumber, bankAccountInfo.accountNumber) && + return Objects.equals(this.accountIdentification, bankAccountInfo.accountIdentification) && Objects.equals(this.accountType, bankAccountInfo.accountType) && - Objects.equals(this.bankBicSwift, bankAccountInfo.bankBicSwift) && - Objects.equals(this.bankCity, bankAccountInfo.bankCity) && - Objects.equals(this.bankCode, bankAccountInfo.bankCode) && - Objects.equals(this.bankName, bankAccountInfo.bankName) && - Objects.equals(this.branchCode, bankAccountInfo.branchCode) && - Objects.equals(this.checkCode, bankAccountInfo.checkCode) && - Objects.equals(this.countryCode, bankAccountInfo.countryCode) && - Objects.equals(this.currencyCode, bankAccountInfo.currencyCode) && - Objects.equals(this.iban, bankAccountInfo.iban); + Objects.equals(this.countryCode, bankAccountInfo.countryCode); } @Override public int hashCode() { - return Objects.hash(accountNumber, accountType, bankBicSwift, bankCity, bankCode, bankName, branchCode, checkCode, countryCode, currencyCode, iban); + return Objects.hash(accountIdentification, accountType, countryCode); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BankAccountInfo {\n"); - sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" accountIdentification: ").append(toIndentedString(accountIdentification)).append("\n"); sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); - sb.append(" bankBicSwift: ").append(toIndentedString(bankBicSwift)).append("\n"); - sb.append(" bankCity: ").append(toIndentedString(bankCity)).append("\n"); - sb.append(" bankCode: ").append(toIndentedString(bankCode)).append("\n"); - sb.append(" bankName: ").append(toIndentedString(bankName)).append("\n"); - sb.append(" branchCode: ").append(toIndentedString(branchCode)).append("\n"); - sb.append(" checkCode: ").append(toIndentedString(checkCode)).append("\n"); sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); - sb.append(" currencyCode: ").append(toIndentedString(currencyCode)).append("\n"); - sb.append(" iban: ").append(toIndentedString(iban)).append("\n"); sb.append("}"); return sb.toString(); } @@ -404,21 +181,12 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("accountNumber"); + openapiFields.add("accountIdentification"); openapiFields.add("accountType"); - openapiFields.add("bankBicSwift"); - openapiFields.add("bankCity"); - openapiFields.add("bankCode"); - openapiFields.add("bankName"); - openapiFields.add("branchCode"); - openapiFields.add("checkCode"); openapiFields.add("countryCode"); - openapiFields.add("currencyCode"); - openapiFields.add("iban"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("currencyCode"); } /** @@ -443,57 +211,18 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BankAccountInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BankAccountInfo.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - // validate the optional field accountNumber - if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + // validate the optional field `accountIdentification` + if (jsonObj.getAsJsonObject("accountIdentification") != null) { + BankAccountInfoAccountIdentification.validateJsonObject(jsonObj.getAsJsonObject("accountIdentification")); } // validate the optional field accountType if (jsonObj.get("accountType") != null && !jsonObj.get("accountType").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `accountType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountType").toString())); } - // validate the optional field bankBicSwift - if (jsonObj.get("bankBicSwift") != null && !jsonObj.get("bankBicSwift").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankBicSwift` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankBicSwift").toString())); - } - // validate the optional field bankCity - if (jsonObj.get("bankCity") != null && !jsonObj.get("bankCity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankCity").toString())); - } - // validate the optional field bankCode - if (jsonObj.get("bankCode") != null && !jsonObj.get("bankCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankCode").toString())); - } - // validate the optional field bankName - if (jsonObj.get("bankName") != null && !jsonObj.get("bankName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankName").toString())); - } - // validate the optional field branchCode - if (jsonObj.get("branchCode") != null && !jsonObj.get("branchCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `branchCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("branchCode").toString())); - } - // validate the optional field checkCode - if (jsonObj.get("checkCode") != null && !jsonObj.get("checkCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkCode").toString())); - } // validate the optional field countryCode if (jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `countryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countryCode").toString())); } - // validate the optional field currencyCode - if (jsonObj.get("currencyCode") != null && !jsonObj.get("currencyCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `currencyCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currencyCode").toString())); - } - // validate the optional field iban - if (jsonObj.get("iban") != null && !jsonObj.get("iban").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `iban` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iban").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfoAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfoAccountIdentification.java new file mode 100644 index 000000000..a67ef5f14 --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfoAccountIdentification.java @@ -0,0 +1,816 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.legalentitymanagement.AULocalAccountIdentification; +import com.adyen.model.legalentitymanagement.AdditionalBankIdentification; +import com.adyen.model.legalentitymanagement.CALocalAccountIdentification; +import com.adyen.model.legalentitymanagement.CZLocalAccountIdentification; +import com.adyen.model.legalentitymanagement.DKLocalAccountIdentification; +import com.adyen.model.legalentitymanagement.HULocalAccountIdentification; +import com.adyen.model.legalentitymanagement.IbanAccountIdentification; +import com.adyen.model.legalentitymanagement.NOLocalAccountIdentification; +import com.adyen.model.legalentitymanagement.NumberAndBicAccountIdentification; +import com.adyen.model.legalentitymanagement.PLLocalAccountIdentification; +import com.adyen.model.legalentitymanagement.SELocalAccountIdentification; +import com.adyen.model.legalentitymanagement.UKLocalAccountIdentification; +import com.adyen.model.legalentitymanagement.USLocalAccountIdentification; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import jakarta.ws.rs.core.GenericType; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +import com.adyen.model.legalentitymanagement.JSON; + + +public class BankAccountInfoAccountIdentification extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(BankAccountInfoAccountIdentification.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BankAccountInfoAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BankAccountInfoAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterAULocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(AULocalAccountIdentification.class)); + final TypeAdapter adapterCALocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(CALocalAccountIdentification.class)); + final TypeAdapter adapterCZLocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(CZLocalAccountIdentification.class)); + final TypeAdapter adapterDKLocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(DKLocalAccountIdentification.class)); + final TypeAdapter adapterHULocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(HULocalAccountIdentification.class)); + final TypeAdapter adapterIbanAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(IbanAccountIdentification.class)); + final TypeAdapter adapterNOLocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(NOLocalAccountIdentification.class)); + final TypeAdapter adapterNumberAndBicAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(NumberAndBicAccountIdentification.class)); + final TypeAdapter adapterPLLocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(PLLocalAccountIdentification.class)); + final TypeAdapter adapterSELocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(SELocalAccountIdentification.class)); + final TypeAdapter adapterUKLocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(UKLocalAccountIdentification.class)); + final TypeAdapter adapterUSLocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(USLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BankAccountInfoAccountIdentification value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `AULocalAccountIdentification` + if (value.getActualInstance() instanceof AULocalAccountIdentification) { + JsonObject obj = adapterAULocalAccountIdentification.toJsonTree((AULocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CALocalAccountIdentification` + if (value.getActualInstance() instanceof CALocalAccountIdentification) { + JsonObject obj = adapterCALocalAccountIdentification.toJsonTree((CALocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `CZLocalAccountIdentification` + if (value.getActualInstance() instanceof CZLocalAccountIdentification) { + JsonObject obj = adapterCZLocalAccountIdentification.toJsonTree((CZLocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `DKLocalAccountIdentification` + if (value.getActualInstance() instanceof DKLocalAccountIdentification) { + JsonObject obj = adapterDKLocalAccountIdentification.toJsonTree((DKLocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `HULocalAccountIdentification` + if (value.getActualInstance() instanceof HULocalAccountIdentification) { + JsonObject obj = adapterHULocalAccountIdentification.toJsonTree((HULocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `IbanAccountIdentification` + if (value.getActualInstance() instanceof IbanAccountIdentification) { + JsonObject obj = adapterIbanAccountIdentification.toJsonTree((IbanAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `NOLocalAccountIdentification` + if (value.getActualInstance() instanceof NOLocalAccountIdentification) { + JsonObject obj = adapterNOLocalAccountIdentification.toJsonTree((NOLocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `NumberAndBicAccountIdentification` + if (value.getActualInstance() instanceof NumberAndBicAccountIdentification) { + JsonObject obj = adapterNumberAndBicAccountIdentification.toJsonTree((NumberAndBicAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `PLLocalAccountIdentification` + if (value.getActualInstance() instanceof PLLocalAccountIdentification) { + JsonObject obj = adapterPLLocalAccountIdentification.toJsonTree((PLLocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `SELocalAccountIdentification` + if (value.getActualInstance() instanceof SELocalAccountIdentification) { + JsonObject obj = adapterSELocalAccountIdentification.toJsonTree((SELocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `UKLocalAccountIdentification` + if (value.getActualInstance() instanceof UKLocalAccountIdentification) { + JsonObject obj = adapterUKLocalAccountIdentification.toJsonTree((UKLocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `USLocalAccountIdentification` + if (value.getActualInstance() instanceof USLocalAccountIdentification) { + JsonObject obj = adapterUSLocalAccountIdentification.toJsonTree((USLocalAccountIdentification)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification"); + } + + @Override + public BankAccountInfoAccountIdentification read(JsonReader in) throws IOException { + Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + + int match = 0; + ArrayList errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize AULocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + AULocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterAULocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'AULocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AULocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AULocalAccountIdentification'", e); + } + + // deserialize CALocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + CALocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterCALocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'CALocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CALocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CALocalAccountIdentification'", e); + } + + // deserialize CZLocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + CZLocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterCZLocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'CZLocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CZLocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CZLocalAccountIdentification'", e); + } + + // deserialize DKLocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + DKLocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterDKLocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'DKLocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for DKLocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'DKLocalAccountIdentification'", e); + } + + // deserialize HULocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + HULocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterHULocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'HULocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for HULocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'HULocalAccountIdentification'", e); + } + + // deserialize IbanAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + IbanAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterIbanAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'IbanAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IbanAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IbanAccountIdentification'", e); + } + + // deserialize NOLocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + NOLocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterNOLocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'NOLocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for NOLocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'NOLocalAccountIdentification'", e); + } + + // deserialize NumberAndBicAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + NumberAndBicAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterNumberAndBicAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'NumberAndBicAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for NumberAndBicAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'NumberAndBicAccountIdentification'", e); + } + + // deserialize PLLocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + PLLocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterPLLocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'PLLocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for PLLocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'PLLocalAccountIdentification'", e); + } + + // deserialize SELocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + SELocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterSELocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'SELocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SELocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SELocalAccountIdentification'", e); + } + + // deserialize UKLocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + UKLocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterUKLocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'UKLocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for UKLocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'UKLocalAccountIdentification'", e); + } + + // deserialize USLocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + USLocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterUSLocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'USLocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for USLocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'USLocalAccountIdentification'", e); + } + + if (match == 1) { + BankAccountInfoAccountIdentification ret = new BankAccountInfoAccountIdentification(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for BankAccountInfoAccountIdentification: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public BankAccountInfoAccountIdentification() { + super("oneOf", Boolean.FALSE); + } + + public BankAccountInfoAccountIdentification(AULocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountInfoAccountIdentification(CALocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountInfoAccountIdentification(CZLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountInfoAccountIdentification(DKLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountInfoAccountIdentification(HULocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountInfoAccountIdentification(IbanAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountInfoAccountIdentification(NOLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountInfoAccountIdentification(NumberAndBicAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountInfoAccountIdentification(PLLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountInfoAccountIdentification(SELocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountInfoAccountIdentification(UKLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountInfoAccountIdentification(USLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AULocalAccountIdentification", new GenericType() { + }); + schemas.put("CALocalAccountIdentification", new GenericType() { + }); + schemas.put("CZLocalAccountIdentification", new GenericType() { + }); + schemas.put("DKLocalAccountIdentification", new GenericType() { + }); + schemas.put("HULocalAccountIdentification", new GenericType() { + }); + schemas.put("IbanAccountIdentification", new GenericType() { + }); + schemas.put("NOLocalAccountIdentification", new GenericType() { + }); + schemas.put("NumberAndBicAccountIdentification", new GenericType() { + }); + schemas.put("PLLocalAccountIdentification", new GenericType() { + }); + schemas.put("SELocalAccountIdentification", new GenericType() { + }); + schemas.put("UKLocalAccountIdentification", new GenericType() { + }); + schemas.put("USLocalAccountIdentification", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return BankAccountInfoAccountIdentification.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AULocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CALocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof CZLocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DKLocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof HULocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof IbanAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof NOLocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof NumberAndBicAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof PLLocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SELocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof UKLocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof USLocalAccountIdentification) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification"); + } + + /** + * Get the actual instance, which can be the following: + * AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification + * + * @return The actual instance (AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AULocalAccountIdentification`. If the actual instance is not `AULocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AULocalAccountIdentification` + * @throws ClassCastException if the instance is not `AULocalAccountIdentification` + */ + public AULocalAccountIdentification getAULocalAccountIdentification() throws ClassCastException { + return (AULocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `CALocalAccountIdentification`. If the actual instance is not `CALocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CALocalAccountIdentification` + * @throws ClassCastException if the instance is not `CALocalAccountIdentification` + */ + public CALocalAccountIdentification getCALocalAccountIdentification() throws ClassCastException { + return (CALocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `CZLocalAccountIdentification`. If the actual instance is not `CZLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CZLocalAccountIdentification` + * @throws ClassCastException if the instance is not `CZLocalAccountIdentification` + */ + public CZLocalAccountIdentification getCZLocalAccountIdentification() throws ClassCastException { + return (CZLocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `DKLocalAccountIdentification`. If the actual instance is not `DKLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DKLocalAccountIdentification` + * @throws ClassCastException if the instance is not `DKLocalAccountIdentification` + */ + public DKLocalAccountIdentification getDKLocalAccountIdentification() throws ClassCastException { + return (DKLocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `HULocalAccountIdentification`. If the actual instance is not `HULocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `HULocalAccountIdentification` + * @throws ClassCastException if the instance is not `HULocalAccountIdentification` + */ + public HULocalAccountIdentification getHULocalAccountIdentification() throws ClassCastException { + return (HULocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `IbanAccountIdentification`. If the actual instance is not `IbanAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IbanAccountIdentification` + * @throws ClassCastException if the instance is not `IbanAccountIdentification` + */ + public IbanAccountIdentification getIbanAccountIdentification() throws ClassCastException { + return (IbanAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `NOLocalAccountIdentification`. If the actual instance is not `NOLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `NOLocalAccountIdentification` + * @throws ClassCastException if the instance is not `NOLocalAccountIdentification` + */ + public NOLocalAccountIdentification getNOLocalAccountIdentification() throws ClassCastException { + return (NOLocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `NumberAndBicAccountIdentification`. If the actual instance is not `NumberAndBicAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `NumberAndBicAccountIdentification` + * @throws ClassCastException if the instance is not `NumberAndBicAccountIdentification` + */ + public NumberAndBicAccountIdentification getNumberAndBicAccountIdentification() throws ClassCastException { + return (NumberAndBicAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `PLLocalAccountIdentification`. If the actual instance is not `PLLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `PLLocalAccountIdentification` + * @throws ClassCastException if the instance is not `PLLocalAccountIdentification` + */ + public PLLocalAccountIdentification getPLLocalAccountIdentification() throws ClassCastException { + return (PLLocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `SELocalAccountIdentification`. If the actual instance is not `SELocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SELocalAccountIdentification` + * @throws ClassCastException if the instance is not `SELocalAccountIdentification` + */ + public SELocalAccountIdentification getSELocalAccountIdentification() throws ClassCastException { + return (SELocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `UKLocalAccountIdentification`. If the actual instance is not `UKLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UKLocalAccountIdentification` + * @throws ClassCastException if the instance is not `UKLocalAccountIdentification` + */ + public UKLocalAccountIdentification getUKLocalAccountIdentification() throws ClassCastException { + return (UKLocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `USLocalAccountIdentification`. If the actual instance is not `USLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `USLocalAccountIdentification` + * @throws ClassCastException if the instance is not `USLocalAccountIdentification` + */ + public USLocalAccountIdentification getUSLocalAccountIdentification() throws ClassCastException { + return (USLocalAccountIdentification)super.getActualInstance(); + } + + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BankAccountInfoAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList errorMessages = new ArrayList<>(); + // validate the json string with AULocalAccountIdentification + try { + AULocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AULocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CALocalAccountIdentification + try { + CALocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CALocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CZLocalAccountIdentification + try { + CZLocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CZLocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with DKLocalAccountIdentification + try { + DKLocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for DKLocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with HULocalAccountIdentification + try { + HULocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for HULocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with IbanAccountIdentification + try { + IbanAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IbanAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with NOLocalAccountIdentification + try { + NOLocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for NOLocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with NumberAndBicAccountIdentification + try { + NumberAndBicAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for NumberAndBicAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with PLLocalAccountIdentification + try { + PLLocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for PLLocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with SELocalAccountIdentification + try { + SELocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SELocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with UKLocalAccountIdentification + try { + UKLocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for UKLocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with USLocalAccountIdentification + try { + USLocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for USLocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for BankAccountInfoAccountIdentification with oneOf schemas: AULocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); + } + } + + /** + * Create an instance of BankAccountInfoAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of BankAccountInfoAccountIdentification + * @throws IOException if the JSON string is invalid with respect to BankAccountInfoAccountIdentification + */ + public static BankAccountInfoAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BankAccountInfoAccountIdentification.class); + } + + /** + * Convert an instance of BankAccountInfoAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java b/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java index 7b477b8af..51366137d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java index 9d6dfb120..618f5bec0 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.adyen.model.legalentitymanagement.CapabilityProblem; import com.adyen.model.legalentitymanagement.SourceOfFunds; import com.adyen.model.legalentitymanagement.WebData; import com.adyen.model.legalentitymanagement.WebDataExemption; @@ -69,10 +70,67 @@ public class BusinessLine { @SerializedName(SERIALIZED_NAME_LEGAL_ENTITY_ID) private String legalEntityId; + public static final String SERIALIZED_NAME_PROBLEMS = "problems"; + @SerializedName(SERIALIZED_NAME_PROBLEMS) + private List problems = null; + public static final String SERIALIZED_NAME_SALES_CHANNELS = "salesChannels"; @SerializedName(SERIALIZED_NAME_SALES_CHANNELS) private List salesChannels = null; + /** + * The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** + */ + @JsonAdapter(ServiceEnum.Adapter.class) + public enum ServiceEnum { + PAYMENTPROCESSING("paymentProcessing"), + + ISSUING("issuing"), + + BANKING("banking"); + + private String value; + + ServiceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ServiceEnum fromValue(String value) { + for (ServiceEnum b : ServiceEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ServiceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ServiceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ServiceEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_SERVICE = "service"; + @SerializedName(SERIALIZED_NAME_SERVICE) + private ServiceEnum service; + public static final String SERIALIZED_NAME_SOURCE_OF_FUNDS = "sourceOfFunds"; @SerializedName(SERIALIZED_NAME_SOURCE_OF_FUNDS) private SourceOfFunds sourceOfFunds; @@ -105,8 +163,10 @@ public BusinessLine capability(String capability) { /** * The capability for which you are creating the business line. For example, **receivePayments**. * @return capability + * @deprecated **/ - @ApiModelProperty(required = true, value = "The capability for which you are creating the business line. For example, **receivePayments**.") + @Deprecated + @ApiModelProperty(value = "The capability for which you are creating the business line. For example, **receivePayments**.") public String getCapability() { return capability; @@ -175,6 +235,36 @@ public void setLegalEntityId(String legalEntityId) { } + public BusinessLine problems(List problems) { + + this.problems = problems; + return this; + } + + public BusinessLine addProblemsItem(CapabilityProblem problemsItem) { + if (this.problems == null) { + this.problems = new ArrayList<>(); + } + this.problems.add(problemsItem); + return this; + } + + /** + * List of the verification errors from capabilities for this supporting entity. + * @return problems + **/ + @ApiModelProperty(value = "List of the verification errors from capabilities for this supporting entity.") + + public List getProblems() { + return problems; + } + + + public void setProblems(List problems) { + this.problems = problems; + } + + public BusinessLine salesChannels(List salesChannels) { this.salesChannels = salesChannels; @@ -190,10 +280,10 @@ public BusinessLine addSalesChannelsItem(String salesChannelsItem) { } /** - * A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `capability` to **receivePayments** or **receiveFromPlatformPayments**. + * A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**. * @return salesChannels **/ - @ApiModelProperty(value = "A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `capability` to **receivePayments** or **receiveFromPlatformPayments**.") + @ApiModelProperty(value = "A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**.") public List getSalesChannels() { return salesChannels; @@ -205,6 +295,28 @@ public void setSalesChannels(List salesChannels) { } + public BusinessLine service(ServiceEnum service) { + + this.service = service; + return this; + } + + /** + * The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** + * @return service + **/ + @ApiModelProperty(required = true, value = "The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking**") + + public ServiceEnum getService() { + return service; + } + + + public void setService(ServiceEnum service) { + this.service = service; + } + + public BusinessLine sourceOfFunds(SourceOfFunds sourceOfFunds) { this.sourceOfFunds = sourceOfFunds; @@ -242,10 +354,10 @@ public BusinessLine addWebDataItem(WebData webDataItem) { } /** - * List of website URLs where your user's goods or services are sold. When this is required for a capability but your user does not have an online presence, provide the reason in the `webDataExemption` object. + * List of website URLs where your user's goods or services are sold. When this is required for a service but your user does not have an online presence, provide the reason in the `webDataExemption` object. * @return webData **/ - @ApiModelProperty(value = "List of website URLs where your user's goods or services are sold. When this is required for a capability but your user does not have an online presence, provide the reason in the `webDataExemption` object.") + @ApiModelProperty(value = "List of website URLs where your user's goods or services are sold. When this is required for a service but your user does not have an online presence, provide the reason in the `webDataExemption` object.") public List getWebData() { return webData; @@ -293,7 +405,9 @@ public boolean equals(Object o) { Objects.equals(this.id, businessLine.id) && Objects.equals(this.industryCode, businessLine.industryCode) && Objects.equals(this.legalEntityId, businessLine.legalEntityId) && + Objects.equals(this.problems, businessLine.problems) && Objects.equals(this.salesChannels, businessLine.salesChannels) && + Objects.equals(this.service, businessLine.service) && Objects.equals(this.sourceOfFunds, businessLine.sourceOfFunds) && Objects.equals(this.webData, businessLine.webData) && Objects.equals(this.webDataExemption, businessLine.webDataExemption); @@ -301,7 +415,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(capability, id, industryCode, legalEntityId, salesChannels, sourceOfFunds, webData, webDataExemption); + return Objects.hash(capability, id, industryCode, legalEntityId, problems, salesChannels, service, sourceOfFunds, webData, webDataExemption); } @Override @@ -312,7 +426,9 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" industryCode: ").append(toIndentedString(industryCode)).append("\n"); sb.append(" legalEntityId: ").append(toIndentedString(legalEntityId)).append("\n"); + sb.append(" problems: ").append(toIndentedString(problems)).append("\n"); sb.append(" salesChannels: ").append(toIndentedString(salesChannels)).append("\n"); + sb.append(" service: ").append(toIndentedString(service)).append("\n"); sb.append(" sourceOfFunds: ").append(toIndentedString(sourceOfFunds)).append("\n"); sb.append(" webData: ").append(toIndentedString(webData)).append("\n"); sb.append(" webDataExemption: ").append(toIndentedString(webDataExemption)).append("\n"); @@ -342,17 +458,19 @@ private String toIndentedString(Object o) { openapiFields.add("id"); openapiFields.add("industryCode"); openapiFields.add("legalEntityId"); + openapiFields.add("problems"); openapiFields.add("salesChannels"); + openapiFields.add("service"); openapiFields.add("sourceOfFunds"); openapiFields.add("webData"); openapiFields.add("webDataExemption"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("capability"); openapiRequiredFields.add("id"); openapiRequiredFields.add("industryCode"); openapiRequiredFields.add("legalEntityId"); + openapiRequiredFields.add("service"); } /** @@ -400,10 +518,29 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("legalEntityId") != null && !jsonObj.get("legalEntityId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `legalEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legalEntityId").toString())); } + JsonArray jsonArrayproblems = jsonObj.getAsJsonArray("problems"); + if (jsonArrayproblems != null) { + // ensure the json data is an array + if (!jsonObj.get("problems").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `problems` to be an array in the JSON string but got `%s`", jsonObj.get("problems").toString())); + } + + // validate the optional field `problems` (array) + for (int i = 0; i < jsonArrayproblems.size(); i++) { + CapabilityProblem.validateJsonObject(jsonArrayproblems.get(i).getAsJsonObject()); + }; + } // ensure the json data is an array if (jsonObj.get("salesChannels") != null && !jsonObj.get("salesChannels").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `salesChannels` to be an array in the JSON string but got `%s`", jsonObj.get("salesChannels").toString())); } + // ensure the field service can be parsed to an enum value + if (jsonObj.get("service") != null) { + if(!jsonObj.get("service").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `service` to be a primitive type in the JSON string but got `%s`", jsonObj.get("service").toString())); + } + ServiceEnum.fromValue(jsonObj.get("service").getAsString()); + } // validate the optional field `sourceOfFunds` if (jsonObj.getAsJsonObject("sourceOfFunds") != null) { SourceOfFunds.validateJsonObject(jsonObj.getAsJsonObject("sourceOfFunds")); diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java index b4de32e34..f66dd5110 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -69,6 +69,59 @@ public class BusinessLineInfo { @SerializedName(SERIALIZED_NAME_SALES_CHANNELS) private List salesChannels = null; + /** + * The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** + */ + @JsonAdapter(ServiceEnum.Adapter.class) + public enum ServiceEnum { + PAYMENTPROCESSING("paymentProcessing"), + + ISSUING("issuing"), + + BANKING("banking"); + + private String value; + + ServiceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ServiceEnum fromValue(String value) { + for (ServiceEnum b : ServiceEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ServiceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ServiceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ServiceEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_SERVICE = "service"; + @SerializedName(SERIALIZED_NAME_SERVICE) + private ServiceEnum service; + public static final String SERIALIZED_NAME_SOURCE_OF_FUNDS = "sourceOfFunds"; @SerializedName(SERIALIZED_NAME_SOURCE_OF_FUNDS) private SourceOfFunds sourceOfFunds; @@ -93,8 +146,10 @@ public BusinessLineInfo capability(String capability) { /** * The capability for which you are creating the business line. For example, **receivePayments**. * @return capability + * @deprecated **/ - @ApiModelProperty(required = true, value = "The capability for which you are creating the business line. For example, **receivePayments**.") + @Deprecated + @ApiModelProperty(value = "The capability for which you are creating the business line. For example, **receivePayments**.") public String getCapability() { return capability; @@ -165,10 +220,10 @@ public BusinessLineInfo addSalesChannelsItem(String salesChannelsItem) { } /** - * A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `capability` to **receivePayments** or **receiveFromPlatformPayments**. + * A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**. * @return salesChannels **/ - @ApiModelProperty(value = "A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `capability` to **receivePayments** or **receiveFromPlatformPayments**.") + @ApiModelProperty(value = "A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**.") public List getSalesChannels() { return salesChannels; @@ -180,6 +235,28 @@ public void setSalesChannels(List salesChannels) { } + public BusinessLineInfo service(ServiceEnum service) { + + this.service = service; + return this; + } + + /** + * The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** + * @return service + **/ + @ApiModelProperty(required = true, value = "The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking**") + + public ServiceEnum getService() { + return service; + } + + + public void setService(ServiceEnum service) { + this.service = service; + } + + public BusinessLineInfo sourceOfFunds(SourceOfFunds sourceOfFunds) { this.sourceOfFunds = sourceOfFunds; @@ -217,10 +294,10 @@ public BusinessLineInfo addWebDataItem(WebData webDataItem) { } /** - * List of website URLs where your user's goods or services are sold. When this is required for a capability but your user does not have an online presence, provide the reason in the `webDataExemption` object. + * List of website URLs where your user's goods or services are sold. When this is required for a service but your user does not have an online presence, provide the reason in the `webDataExemption` object. * @return webData **/ - @ApiModelProperty(value = "List of website URLs where your user's goods or services are sold. When this is required for a capability but your user does not have an online presence, provide the reason in the `webDataExemption` object.") + @ApiModelProperty(value = "List of website URLs where your user's goods or services are sold. When this is required for a service but your user does not have an online presence, provide the reason in the `webDataExemption` object.") public List getWebData() { return webData; @@ -268,6 +345,7 @@ public boolean equals(Object o) { Objects.equals(this.industryCode, businessLineInfo.industryCode) && Objects.equals(this.legalEntityId, businessLineInfo.legalEntityId) && Objects.equals(this.salesChannels, businessLineInfo.salesChannels) && + Objects.equals(this.service, businessLineInfo.service) && Objects.equals(this.sourceOfFunds, businessLineInfo.sourceOfFunds) && Objects.equals(this.webData, businessLineInfo.webData) && Objects.equals(this.webDataExemption, businessLineInfo.webDataExemption); @@ -275,7 +353,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(capability, industryCode, legalEntityId, salesChannels, sourceOfFunds, webData, webDataExemption); + return Objects.hash(capability, industryCode, legalEntityId, salesChannels, service, sourceOfFunds, webData, webDataExemption); } @Override @@ -286,6 +364,7 @@ public String toString() { sb.append(" industryCode: ").append(toIndentedString(industryCode)).append("\n"); sb.append(" legalEntityId: ").append(toIndentedString(legalEntityId)).append("\n"); sb.append(" salesChannels: ").append(toIndentedString(salesChannels)).append("\n"); + sb.append(" service: ").append(toIndentedString(service)).append("\n"); sb.append(" sourceOfFunds: ").append(toIndentedString(sourceOfFunds)).append("\n"); sb.append(" webData: ").append(toIndentedString(webData)).append("\n"); sb.append(" webDataExemption: ").append(toIndentedString(webDataExemption)).append("\n"); @@ -315,15 +394,16 @@ private String toIndentedString(Object o) { openapiFields.add("industryCode"); openapiFields.add("legalEntityId"); openapiFields.add("salesChannels"); + openapiFields.add("service"); openapiFields.add("sourceOfFunds"); openapiFields.add("webData"); openapiFields.add("webDataExemption"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("capability"); openapiRequiredFields.add("industryCode"); openapiRequiredFields.add("legalEntityId"); + openapiRequiredFields.add("service"); } /** @@ -371,6 +451,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("salesChannels") != null && !jsonObj.get("salesChannels").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `salesChannels` to be an array in the JSON string but got `%s`", jsonObj.get("salesChannels").toString())); } + // ensure the field service can be parsed to an enum value + if (jsonObj.get("service") != null) { + if(!jsonObj.get("service").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `service` to be a primitive type in the JSON string but got `%s`", jsonObj.get("service").toString())); + } + ServiceEnum.fromValue(jsonObj.get("service").getAsString()); + } // validate the optional field `sourceOfFunds` if (jsonObj.getAsJsonObject("sourceOfFunds") != null) { SourceOfFunds.validateJsonObject(jsonObj.getAsJsonObject("sourceOfFunds")); diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java index d3563470a..7320b32e1 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -69,6 +69,59 @@ public class BusinessLineInfoUpdate { @SerializedName(SERIALIZED_NAME_SALES_CHANNELS) private List salesChannels = null; + /** + * The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** + */ + @JsonAdapter(ServiceEnum.Adapter.class) + public enum ServiceEnum { + PAYMENTPROCESSING("paymentProcessing"), + + ISSUING("issuing"), + + BANKING("banking"); + + private String value; + + ServiceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ServiceEnum fromValue(String value) { + for (ServiceEnum b : ServiceEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ServiceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ServiceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ServiceEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_SERVICE = "service"; + @SerializedName(SERIALIZED_NAME_SERVICE) + private ServiceEnum service; + public static final String SERIALIZED_NAME_SOURCE_OF_FUNDS = "sourceOfFunds"; @SerializedName(SERIALIZED_NAME_SOURCE_OF_FUNDS) private SourceOfFunds sourceOfFunds; @@ -93,7 +146,9 @@ public BusinessLineInfoUpdate capability(String capability) { /** * The capability for which you are creating the business line. For example, **receivePayments**. * @return capability + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The capability for which you are creating the business line. For example, **receivePayments**.") public String getCapability() { @@ -165,10 +220,10 @@ public BusinessLineInfoUpdate addSalesChannelsItem(String salesChannelsItem) { } /** - * A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `capability` to **receivePayments** or **receiveFromPlatformPayments**. + * A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**. * @return salesChannels **/ - @ApiModelProperty(value = "A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `capability` to **receivePayments** or **receiveFromPlatformPayments**.") + @ApiModelProperty(value = "A list of channels where goods or services are sold. Possible values: **pos**, **posMoto**, **eCommerce**, **ecomMoto**, **payByLink**. Required only in combination with the `service` **paymentProcessing**.") public List getSalesChannels() { return salesChannels; @@ -180,6 +235,28 @@ public void setSalesChannels(List salesChannels) { } + public BusinessLineInfoUpdate service(ServiceEnum service) { + + this.service = service; + return this; + } + + /** + * The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** + * @return service + **/ + @ApiModelProperty(required = true, value = "The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking**") + + public ServiceEnum getService() { + return service; + } + + + public void setService(ServiceEnum service) { + this.service = service; + } + + public BusinessLineInfoUpdate sourceOfFunds(SourceOfFunds sourceOfFunds) { this.sourceOfFunds = sourceOfFunds; @@ -217,10 +294,10 @@ public BusinessLineInfoUpdate addWebDataItem(WebData webDataItem) { } /** - * List of website URLs where your user's goods or services are sold. When this is required for a capability but your user does not have an online presence, provide the reason in the `webDataExemption` object. + * List of website URLs where your user's goods or services are sold. When this is required for a service but your user does not have an online presence, provide the reason in the `webDataExemption` object. * @return webData **/ - @ApiModelProperty(value = "List of website URLs where your user's goods or services are sold. When this is required for a capability but your user does not have an online presence, provide the reason in the `webDataExemption` object.") + @ApiModelProperty(value = "List of website URLs where your user's goods or services are sold. When this is required for a service but your user does not have an online presence, provide the reason in the `webDataExemption` object.") public List getWebData() { return webData; @@ -268,6 +345,7 @@ public boolean equals(Object o) { Objects.equals(this.industryCode, businessLineInfoUpdate.industryCode) && Objects.equals(this.legalEntityId, businessLineInfoUpdate.legalEntityId) && Objects.equals(this.salesChannels, businessLineInfoUpdate.salesChannels) && + Objects.equals(this.service, businessLineInfoUpdate.service) && Objects.equals(this.sourceOfFunds, businessLineInfoUpdate.sourceOfFunds) && Objects.equals(this.webData, businessLineInfoUpdate.webData) && Objects.equals(this.webDataExemption, businessLineInfoUpdate.webDataExemption); @@ -275,7 +353,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(capability, industryCode, legalEntityId, salesChannels, sourceOfFunds, webData, webDataExemption); + return Objects.hash(capability, industryCode, legalEntityId, salesChannels, service, sourceOfFunds, webData, webDataExemption); } @Override @@ -286,6 +364,7 @@ public String toString() { sb.append(" industryCode: ").append(toIndentedString(industryCode)).append("\n"); sb.append(" legalEntityId: ").append(toIndentedString(legalEntityId)).append("\n"); sb.append(" salesChannels: ").append(toIndentedString(salesChannels)).append("\n"); + sb.append(" service: ").append(toIndentedString(service)).append("\n"); sb.append(" sourceOfFunds: ").append(toIndentedString(sourceOfFunds)).append("\n"); sb.append(" webData: ").append(toIndentedString(webData)).append("\n"); sb.append(" webDataExemption: ").append(toIndentedString(webDataExemption)).append("\n"); @@ -315,12 +394,14 @@ private String toIndentedString(Object o) { openapiFields.add("industryCode"); openapiFields.add("legalEntityId"); openapiFields.add("salesChannels"); + openapiFields.add("service"); openapiFields.add("sourceOfFunds"); openapiFields.add("webData"); openapiFields.add("webDataExemption"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("service"); } /** @@ -345,6 +426,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BusinessLineInfoUpdate` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BusinessLineInfoUpdate.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } // validate the optional field capability if (jsonObj.get("capability") != null && !jsonObj.get("capability").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `capability` to be a primitive type in the JSON string but got `%s`", jsonObj.get("capability").toString())); @@ -361,6 +449,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("salesChannels") != null && !jsonObj.get("salesChannels").isJsonArray()) { throw new IllegalArgumentException(String.format("Expected the field `salesChannels` to be an array in the JSON string but got `%s`", jsonObj.get("salesChannels").toString())); } + // ensure the field service can be parsed to an enum value + if (jsonObj.get("service") != null) { + if(!jsonObj.get("service").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `service` to be a primitive type in the JSON string but got `%s`", jsonObj.get("service").toString())); + } + ServiceEnum.fromValue(jsonObj.get("service").getAsString()); + } // validate the optional field `sourceOfFunds` if (jsonObj.getAsJsonObject("sourceOfFunds") != null) { SourceOfFunds.validateJsonObject(jsonObj.getAsJsonObject("sourceOfFunds")); diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java index bd981127b..de859441d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java new file mode 100644 index 000000000..3ef27a2dc --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java @@ -0,0 +1,449 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * CALocalAccountIdentification + */ + +public class CALocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + /** + * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + */ + @JsonAdapter(AccountTypeEnum.Adapter.class) + public enum AccountTypeEnum { + CHECKING("checking"), + + SAVINGS("savings"); + + private String value; + + AccountTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AccountTypeEnum fromValue(String value) { + for (AccountTypeEnum b : AccountTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AccountTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AccountTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AccountTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ACCOUNT_TYPE = "accountType"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_TYPE) + private AccountTypeEnum accountType = AccountTypeEnum.CHECKING; + + public static final String SERIALIZED_NAME_INSTITUTION_NUMBER = "institutionNumber"; + @SerializedName(SERIALIZED_NAME_INSTITUTION_NUMBER) + private String institutionNumber; + + public static final String SERIALIZED_NAME_TRANSIT_NUMBER = "transitNumber"; + @SerializedName(SERIALIZED_NAME_TRANSIT_NUMBER) + private String transitNumber; + + /** + * **caLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CALOCAL("caLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.CALOCAL; + + public CALocalAccountIdentification() { + } + + public CALocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 5- to 12-digit bank account number, without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 5- to 12-digit bank account number, without separators or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public CALocalAccountIdentification accountType(AccountTypeEnum accountType) { + + this.accountType = accountType; + return this; + } + + /** + * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * @return accountType + **/ + @ApiModelProperty(value = "The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**.") + + public AccountTypeEnum getAccountType() { + return accountType; + } + + + public void setAccountType(AccountTypeEnum accountType) { + this.accountType = accountType; + } + + + public CALocalAccountIdentification institutionNumber(String institutionNumber) { + + this.institutionNumber = institutionNumber; + return this; + } + + /** + * The 3-digit institution number, without separators or whitespace. + * @return institutionNumber + **/ + @ApiModelProperty(required = true, value = "The 3-digit institution number, without separators or whitespace.") + + public String getInstitutionNumber() { + return institutionNumber; + } + + + public void setInstitutionNumber(String institutionNumber) { + this.institutionNumber = institutionNumber; + } + + + public CALocalAccountIdentification transitNumber(String transitNumber) { + + this.transitNumber = transitNumber; + return this; + } + + /** + * The 5-digit transit number, without separators or whitespace. + * @return transitNumber + **/ + @ApiModelProperty(required = true, value = "The 5-digit transit number, without separators or whitespace.") + + public String getTransitNumber() { + return transitNumber; + } + + + public void setTransitNumber(String transitNumber) { + this.transitNumber = transitNumber; + } + + + public CALocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **caLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**caLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CALocalAccountIdentification caLocalAccountIdentification = (CALocalAccountIdentification) o; + return Objects.equals(this.accountNumber, caLocalAccountIdentification.accountNumber) && + Objects.equals(this.accountType, caLocalAccountIdentification.accountType) && + Objects.equals(this.institutionNumber, caLocalAccountIdentification.institutionNumber) && + Objects.equals(this.transitNumber, caLocalAccountIdentification.transitNumber) && + Objects.equals(this.type, caLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, accountType, institutionNumber, transitNumber, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CALocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); + sb.append(" institutionNumber: ").append(toIndentedString(institutionNumber)).append("\n"); + sb.append(" transitNumber: ").append(toIndentedString(transitNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("accountType"); + openapiFields.add("institutionNumber"); + openapiFields.add("transitNumber"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("institutionNumber"); + openapiRequiredFields.add("transitNumber"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CALocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CALocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CALocalAccountIdentification is not found in the empty JSON string", CALocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CALocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CALocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CALocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // ensure the field accountType can be parsed to an enum value + if (jsonObj.get("accountType") != null) { + if(!jsonObj.get("accountType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountType").toString())); + } + AccountTypeEnum.fromValue(jsonObj.get("accountType").getAsString()); + } + // validate the optional field institutionNumber + if (jsonObj.get("institutionNumber") != null && !jsonObj.get("institutionNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `institutionNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("institutionNumber").toString())); + } + // validate the optional field transitNumber + if (jsonObj.get("transitNumber") != null && !jsonObj.get("transitNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transitNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transitNumber").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CALocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CALocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CALocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CALocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CALocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CALocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of CALocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to CALocalAccountIdentification + */ + public static CALocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CALocalAccountIdentification.class); + } + + /** + * Convert an instance of CALocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java new file mode 100644 index 000000000..1515efc2c --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java @@ -0,0 +1,332 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * CZLocalAccountIdentification + */ + +public class CZLocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_BANK_CODE = "bankCode"; + @SerializedName(SERIALIZED_NAME_BANK_CODE) + private String bankCode; + + /** + * **czLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CZLOCAL("czLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.CZLOCAL; + + public CZLocalAccountIdentification() { + } + + public CZLocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 2- to 16-digit bank account number (Číslo účtu) in the following format: - The optional prefix (předčíslí). - The required second part (základní část) which must be at least two non-zero digits. Examples: - **19-123457** (with prefix) - **123457** (without prefix) - **000019-0000123457** (with prefix, normalized) - **000000-0000123457** (without prefix, normalized) + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 2- to 16-digit bank account number (Číslo účtu) in the following format: - The optional prefix (předčíslí). - The required second part (základní část) which must be at least two non-zero digits. Examples: - **19-123457** (with prefix) - **123457** (without prefix) - **000019-0000123457** (with prefix, normalized) - **000000-0000123457** (without prefix, normalized)") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public CZLocalAccountIdentification bankCode(String bankCode) { + + this.bankCode = bankCode; + return this; + } + + /** + * The 4-digit bank code (Kód banky), without separators or whitespace. + * @return bankCode + **/ + @ApiModelProperty(required = true, value = "The 4-digit bank code (Kód banky), without separators or whitespace.") + + public String getBankCode() { + return bankCode; + } + + + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + + public CZLocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **czLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**czLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CZLocalAccountIdentification czLocalAccountIdentification = (CZLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, czLocalAccountIdentification.accountNumber) && + Objects.equals(this.bankCode, czLocalAccountIdentification.bankCode) && + Objects.equals(this.type, czLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, bankCode, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CZLocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" bankCode: ").append(toIndentedString(bankCode)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("bankCode"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("bankCode"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CZLocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CZLocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CZLocalAccountIdentification is not found in the empty JSON string", CZLocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CZLocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CZLocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CZLocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // validate the optional field bankCode + if (jsonObj.get("bankCode") != null && !jsonObj.get("bankCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bankCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankCode").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CZLocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CZLocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CZLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CZLocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CZLocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CZLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of CZLocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to CZLocalAccountIdentification + */ + public static CZLocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CZLocalAccountIdentification.class); + } + + /** + * Convert an instance of CZLocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CalculateTermsOfServiceStatusResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/CalculateTermsOfServiceStatusResponse.java deleted file mode 100644 index b7b346cd7..000000000 --- a/src/main/java/com/adyen/model/legalentitymanagement/CalculateTermsOfServiceStatusResponse.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Legal Entity Management API - * - * The version of the OpenAPI document: 2 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.model.legalentitymanagement; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import com.adyen.model.legalentitymanagement.JSON; - -/** - * CalculateTermsOfServiceStatusResponse - */ - -public class CalculateTermsOfServiceStatusResponse { - /** - * Gets or Sets termsOfServiceTypes - */ - @JsonAdapter(TermsOfServiceTypesEnum.Adapter.class) - public enum TermsOfServiceTypesEnum { - ADYENACCOUNT("adyenAccount"), - - ADYENCAPITAL("adyenCapital"), - - ADYENCARD("adyenCard"), - - ADYENFORPLATFORMSADVANCED("adyenForPlatformsAdvanced"), - - ADYENFORPLATFORMSMANAGE("adyenForPlatformsManage"), - - ADYENFRANCHISEE("adyenFranchisee"), - - ADYENISSUING("adyenIssuing"); - - private String value; - - TermsOfServiceTypesEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static TermsOfServiceTypesEnum fromValue(String value) { - for (TermsOfServiceTypesEnum b : TermsOfServiceTypesEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TermsOfServiceTypesEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TermsOfServiceTypesEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TermsOfServiceTypesEnum.fromValue(value); - } - } - } - - public static final String SERIALIZED_NAME_TERMS_OF_SERVICE_TYPES = "termsOfServiceTypes"; - @SerializedName(SERIALIZED_NAME_TERMS_OF_SERVICE_TYPES) - private List termsOfServiceTypes = null; - - public CalculateTermsOfServiceStatusResponse() { - } - - public CalculateTermsOfServiceStatusResponse termsOfServiceTypes(List termsOfServiceTypes) { - - this.termsOfServiceTypes = termsOfServiceTypes; - return this; - } - - public CalculateTermsOfServiceStatusResponse addTermsOfServiceTypesItem(TermsOfServiceTypesEnum termsOfServiceTypesItem) { - if (this.termsOfServiceTypes == null) { - this.termsOfServiceTypes = new ArrayList<>(); - } - this.termsOfServiceTypes.add(termsOfServiceTypesItem); - return this; - } - - /** - * The type of Terms of Service that the legal entity needs to accept. If empty, no Terms of Service needs to be accepted. - * @return termsOfServiceTypes - **/ - @ApiModelProperty(value = "The type of Terms of Service that the legal entity needs to accept. If empty, no Terms of Service needs to be accepted.") - - public List getTermsOfServiceTypes() { - return termsOfServiceTypes; - } - - - public void setTermsOfServiceTypes(List termsOfServiceTypes) { - this.termsOfServiceTypes = termsOfServiceTypes; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CalculateTermsOfServiceStatusResponse calculateTermsOfServiceStatusResponse = (CalculateTermsOfServiceStatusResponse) o; - return Objects.equals(this.termsOfServiceTypes, calculateTermsOfServiceStatusResponse.termsOfServiceTypes); - } - - @Override - public int hashCode() { - return Objects.hash(termsOfServiceTypes); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CalculateTermsOfServiceStatusResponse {\n"); - sb.append(" termsOfServiceTypes: ").append(toIndentedString(termsOfServiceTypes)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("termsOfServiceTypes"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to CalculateTermsOfServiceStatusResponse - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (CalculateTermsOfServiceStatusResponse.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in CalculateTermsOfServiceStatusResponse is not found in the empty JSON string", CalculateTermsOfServiceStatusResponse.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!CalculateTermsOfServiceStatusResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CalculateTermsOfServiceStatusResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // ensure the json data is an array - if (jsonObj.get("termsOfServiceTypes") != null && !jsonObj.get("termsOfServiceTypes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `termsOfServiceTypes` to be an array in the JSON string but got `%s`", jsonObj.get("termsOfServiceTypes").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!CalculateTermsOfServiceStatusResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CalculateTermsOfServiceStatusResponse' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(CalculateTermsOfServiceStatusResponse.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, CalculateTermsOfServiceStatusResponse value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public CalculateTermsOfServiceStatusResponse read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of CalculateTermsOfServiceStatusResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of CalculateTermsOfServiceStatusResponse - * @throws IOException if the JSON string is invalid with respect to CalculateTermsOfServiceStatusResponse - */ - public static CalculateTermsOfServiceStatusResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CalculateTermsOfServiceStatusResponse.class); - } - - /** - * Convert an instance of CalculateTermsOfServiceStatusResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java index ed28414f8..8e0ae8a3c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java index 4057e0dc8..2058f81a3 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java index 8b593090d..303baf494 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilitySettings.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilitySettings.java index 490a994ae..f06f5ddd1 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilitySettings.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilitySettings.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java new file mode 100644 index 000000000..199ef9dad --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java @@ -0,0 +1,332 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * DKLocalAccountIdentification + */ + +public class DKLocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_BANK_CODE = "bankCode"; + @SerializedName(SERIALIZED_NAME_BANK_CODE) + private String bankCode; + + /** + * **dkLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + DKLOCAL("dkLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.DKLOCAL; + + public DKLocalAccountIdentification() { + } + + public DKLocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 4-10 digits bank account number (Kontonummer) (without separators or whitespace). + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 4-10 digits bank account number (Kontonummer) (without separators or whitespace).") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public DKLocalAccountIdentification bankCode(String bankCode) { + + this.bankCode = bankCode; + return this; + } + + /** + * The 4-digit bank code (Registreringsnummer) (without separators or whitespace). + * @return bankCode + **/ + @ApiModelProperty(required = true, value = "The 4-digit bank code (Registreringsnummer) (without separators or whitespace).") + + public String getBankCode() { + return bankCode; + } + + + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + + public DKLocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **dkLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**dkLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DKLocalAccountIdentification dkLocalAccountIdentification = (DKLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, dkLocalAccountIdentification.accountNumber) && + Objects.equals(this.bankCode, dkLocalAccountIdentification.bankCode) && + Objects.equals(this.type, dkLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, bankCode, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DKLocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" bankCode: ").append(toIndentedString(bankCode)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("bankCode"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("bankCode"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DKLocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DKLocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DKLocalAccountIdentification is not found in the empty JSON string", DKLocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DKLocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DKLocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DKLocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // validate the optional field bankCode + if (jsonObj.get("bankCode") != null && !jsonObj.get("bankCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bankCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankCode").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DKLocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DKLocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DKLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, DKLocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DKLocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DKLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of DKLocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to DKLocalAccountIdentification + */ + public static DKLocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DKLocalAccountIdentification.class); + } + + /** + * Convert an instance of DKLocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Document.java b/src/main/java/com/adyen/model/legalentitymanagement/Document.java index 5dba8f503..a6b855a68 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Document.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Document.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/DocumentReference.java b/src/main/java/com/adyen/model/legalentitymanagement/DocumentReference.java index 21cbb7110..acc696eec 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/DocumentReference.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/DocumentReference.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java b/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java index 7b8fbea63..b87a5ea25 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java new file mode 100644 index 000000000..505345337 --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java @@ -0,0 +1,208 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * GeneratePciDescriptionRequest + */ + +public class GeneratePciDescriptionRequest { + public static final String SERIALIZED_NAME_LANGUAGE = "language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + private String language; + + public GeneratePciDescriptionRequest() { + } + + public GeneratePciDescriptionRequest language(String language) { + + this.language = language; + return this; + } + + /** + * Sets the language of the PCI questionnaire. Its value is a two-character [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code, for example, **en**. + * @return language + **/ + @ApiModelProperty(value = "Sets the language of the PCI questionnaire. Its value is a two-character [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code, for example, **en**.") + + public String getLanguage() { + return language; + } + + + public void setLanguage(String language) { + this.language = language; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneratePciDescriptionRequest generatePciDescriptionRequest = (GeneratePciDescriptionRequest) o; + return Objects.equals(this.language, generatePciDescriptionRequest.language); + } + + @Override + public int hashCode() { + return Objects.hash(language); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneratePciDescriptionRequest {\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("language"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GeneratePciDescriptionRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GeneratePciDescriptionRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GeneratePciDescriptionRequest is not found in the empty JSON string", GeneratePciDescriptionRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GeneratePciDescriptionRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GeneratePciDescriptionRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field language + if (jsonObj.get("language") != null && !jsonObj.get("language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("language").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GeneratePciDescriptionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GeneratePciDescriptionRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GeneratePciDescriptionRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GeneratePciDescriptionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GeneratePciDescriptionRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GeneratePciDescriptionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GeneratePciDescriptionRequest + * @throws IOException if the JSON string is invalid with respect to GeneratePciDescriptionRequest + */ + public static GeneratePciDescriptionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GeneratePciDescriptionRequest.class); + } + + /** + * Convert an instance of GeneratePciDescriptionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java new file mode 100644 index 000000000..d44ac3a88 --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java @@ -0,0 +1,280 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * GeneratePciDescriptionResponse + */ + +public class GeneratePciDescriptionResponse { + public static final String SERIALIZED_NAME_CONTENT = "content"; + @SerializedName(SERIALIZED_NAME_CONTENT) + private byte[] content; + + public static final String SERIALIZED_NAME_LANGUAGE = "language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + private String language; + + public static final String SERIALIZED_NAME_PCI_TEMPLATE_REFERENCES = "pciTemplateReferences"; + @SerializedName(SERIALIZED_NAME_PCI_TEMPLATE_REFERENCES) + private List pciTemplateReferences = null; + + public GeneratePciDescriptionResponse() { + } + + public GeneratePciDescriptionResponse content(byte[] content) { + + this.content = content; + return this; + } + + /** + * The generated questionnaires in a base64 encoded format. + * @return content + **/ + @ApiModelProperty(value = "The generated questionnaires in a base64 encoded format.") + + public byte[] getContent() { + return content; + } + + + public void setContent(byte[] content) { + this.content = content; + } + + + public GeneratePciDescriptionResponse language(String language) { + + this.language = language; + return this; + } + + /** + * The two-letter [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code for the questionnaire. For example, **en**. + * @return language + **/ + @ApiModelProperty(value = "The two-letter [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code for the questionnaire. For example, **en**.") + + public String getLanguage() { + return language; + } + + + public void setLanguage(String language) { + this.language = language; + } + + + public GeneratePciDescriptionResponse pciTemplateReferences(List pciTemplateReferences) { + + this.pciTemplateReferences = pciTemplateReferences; + return this; + } + + public GeneratePciDescriptionResponse addPciTemplateReferencesItem(String pciTemplateReferencesItem) { + if (this.pciTemplateReferences == null) { + this.pciTemplateReferences = new ArrayList<>(); + } + this.pciTemplateReferences.add(pciTemplateReferencesItem); + return this; + } + + /** + * The array of Adyen-generated unique identifiers for the questionnaires. + * @return pciTemplateReferences + **/ + @ApiModelProperty(value = "The array of Adyen-generated unique identifiers for the questionnaires.") + + public List getPciTemplateReferences() { + return pciTemplateReferences; + } + + + public void setPciTemplateReferences(List pciTemplateReferences) { + this.pciTemplateReferences = pciTemplateReferences; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeneratePciDescriptionResponse generatePciDescriptionResponse = (GeneratePciDescriptionResponse) o; + return Arrays.equals(this.content, generatePciDescriptionResponse.content) && + Objects.equals(this.language, generatePciDescriptionResponse.language) && + Objects.equals(this.pciTemplateReferences, generatePciDescriptionResponse.pciTemplateReferences); + } + + @Override + public int hashCode() { + return Objects.hash(Arrays.hashCode(content), language, pciTemplateReferences); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeneratePciDescriptionResponse {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" pciTemplateReferences: ").append(toIndentedString(pciTemplateReferences)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("content"); + openapiFields.add("language"); + openapiFields.add("pciTemplateReferences"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GeneratePciDescriptionResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GeneratePciDescriptionResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GeneratePciDescriptionResponse is not found in the empty JSON string", GeneratePciDescriptionResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GeneratePciDescriptionResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GeneratePciDescriptionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field language + if (jsonObj.get("language") != null && !jsonObj.get("language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("language").toString())); + } + // ensure the json data is an array + if (jsonObj.get("pciTemplateReferences") != null && !jsonObj.get("pciTemplateReferences").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pciTemplateReferences` to be an array in the JSON string but got `%s`", jsonObj.get("pciTemplateReferences").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GeneratePciDescriptionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GeneratePciDescriptionResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GeneratePciDescriptionResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GeneratePciDescriptionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GeneratePciDescriptionResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GeneratePciDescriptionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GeneratePciDescriptionResponse + * @throws IOException if the JSON string is invalid with respect to GeneratePciDescriptionResponse + */ + public static GeneratePciDescriptionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GeneratePciDescriptionResponse.class); + } + + /** + * Convert an instance of GeneratePciDescriptionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java new file mode 100644 index 000000000..cefb2a4a3 --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java @@ -0,0 +1,227 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.legalentitymanagement.PciDocumentInfo; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * GetPciQuestionnaireInfosResponse + */ + +public class GetPciQuestionnaireInfosResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private List data = null; + + public GetPciQuestionnaireInfosResponse() { + } + + public GetPciQuestionnaireInfosResponse data(List data) { + + this.data = data; + return this; + } + + public GetPciQuestionnaireInfosResponse addDataItem(PciDocumentInfo dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Information about the signed PCI questionnaires. + * @return data + **/ + @ApiModelProperty(value = "Information about the signed PCI questionnaires.") + + public List getData() { + return data; + } + + + public void setData(List data) { + this.data = data; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPciQuestionnaireInfosResponse getPciQuestionnaireInfosResponse = (GetPciQuestionnaireInfosResponse) o; + return Objects.equals(this.data, getPciQuestionnaireInfosResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPciQuestionnaireInfosResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetPciQuestionnaireInfosResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GetPciQuestionnaireInfosResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GetPciQuestionnaireInfosResponse is not found in the empty JSON string", GetPciQuestionnaireInfosResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetPciQuestionnaireInfosResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetPciQuestionnaireInfosResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + PciDocumentInfo.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPciQuestionnaireInfosResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetPciQuestionnaireInfosResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetPciQuestionnaireInfosResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetPciQuestionnaireInfosResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPciQuestionnaireInfosResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetPciQuestionnaireInfosResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPciQuestionnaireInfosResponse + * @throws IOException if the JSON string is invalid with respect to GetPciQuestionnaireInfosResponse + */ + public static GetPciQuestionnaireInfosResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetPciQuestionnaireInfosResponse.class); + } + + /** + * Convert an instance of GetPciQuestionnaireInfosResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java new file mode 100644 index 000000000..0dcf78c65 --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java @@ -0,0 +1,296 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * GetPciQuestionnaireResponse + */ + +public class GetPciQuestionnaireResponse { + public static final String SERIALIZED_NAME_CONTENT = "content"; + @SerializedName(SERIALIZED_NAME_CONTENT) + private byte[] content; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_VALID_UNTIL = "validUntil"; + @SerializedName(SERIALIZED_NAME_VALID_UNTIL) + private OffsetDateTime validUntil; + + public GetPciQuestionnaireResponse() { + } + + public GetPciQuestionnaireResponse content(byte[] content) { + + this.content = content; + return this; + } + + /** + * The generated questionnaire in a base64 encoded format. + * @return content + **/ + @ApiModelProperty(value = "The generated questionnaire in a base64 encoded format.") + + public byte[] getContent() { + return content; + } + + + public void setContent(byte[] content) { + this.content = content; + } + + + public GetPciQuestionnaireResponse createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The date the questionnaire was created, in ISO 8601 extended format. For example, 2022-12-18T10:15:30+01:00 + * @return createdAt + **/ + @ApiModelProperty(value = "The date the questionnaire was created, in ISO 8601 extended format. For example, 2022-12-18T10:15:30+01:00") + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public GetPciQuestionnaireResponse id(String id) { + + this.id = id; + return this; + } + + /** + * The unique identifier of the signed questionnaire. + * @return id + **/ + @ApiModelProperty(value = "The unique identifier of the signed questionnaire.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public GetPciQuestionnaireResponse validUntil(OffsetDateTime validUntil) { + + this.validUntil = validUntil; + return this; + } + + /** + * The expiration date of the questionnaire, in ISO 8601 extended format. For example, 2022-12-18T10:15:30+01:00 + * @return validUntil + **/ + @ApiModelProperty(value = "The expiration date of the questionnaire, in ISO 8601 extended format. For example, 2022-12-18T10:15:30+01:00") + + public OffsetDateTime getValidUntil() { + return validUntil; + } + + + public void setValidUntil(OffsetDateTime validUntil) { + this.validUntil = validUntil; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPciQuestionnaireResponse getPciQuestionnaireResponse = (GetPciQuestionnaireResponse) o; + return Arrays.equals(this.content, getPciQuestionnaireResponse.content) && + Objects.equals(this.createdAt, getPciQuestionnaireResponse.createdAt) && + Objects.equals(this.id, getPciQuestionnaireResponse.id) && + Objects.equals(this.validUntil, getPciQuestionnaireResponse.validUntil); + } + + @Override + public int hashCode() { + return Objects.hash(Arrays.hashCode(content), createdAt, id, validUntil); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetPciQuestionnaireResponse {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" validUntil: ").append(toIndentedString(validUntil)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("content"); + openapiFields.add("createdAt"); + openapiFields.add("id"); + openapiFields.add("validUntil"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetPciQuestionnaireResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GetPciQuestionnaireResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GetPciQuestionnaireResponse is not found in the empty JSON string", GetPciQuestionnaireResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetPciQuestionnaireResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetPciQuestionnaireResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetPciQuestionnaireResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetPciQuestionnaireResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetPciQuestionnaireResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetPciQuestionnaireResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetPciQuestionnaireResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetPciQuestionnaireResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetPciQuestionnaireResponse + * @throws IOException if the JSON string is invalid with respect to GetPciQuestionnaireResponse + */ + public static GetPciQuestionnaireResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetPciQuestionnaireResponse.class); + } + + /** + * Convert an instance of GetPciQuestionnaireResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java index 1a70f9791..fba64234d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java index 503d04beb..c2ff2a26f 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java index 72d639b3a..b2329e2b1 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/HULocalAccountIdentification.java new file mode 100644 index 000000000..8e3520dec --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/HULocalAccountIdentification.java @@ -0,0 +1,298 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * HULocalAccountIdentification + */ + +public class HULocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + /** + * **huLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + HULOCAL("huLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.HULOCAL; + + public HULocalAccountIdentification() { + } + + public HULocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 24-digit bank account number, without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 24-digit bank account number, without separators or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public HULocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **huLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**huLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HULocalAccountIdentification huLocalAccountIdentification = (HULocalAccountIdentification) o; + return Objects.equals(this.accountNumber, huLocalAccountIdentification.accountNumber) && + Objects.equals(this.type, huLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HULocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HULocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (HULocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in HULocalAccountIdentification is not found in the empty JSON string", HULocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HULocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HULocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : HULocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!HULocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HULocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HULocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, HULocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public HULocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HULocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of HULocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to HULocalAccountIdentification + */ + public static HULocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HULocalAccountIdentification.class); + } + + /** + * Convert an instance of HULocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java new file mode 100644 index 000000000..45d9e0048 --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java @@ -0,0 +1,298 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * IbanAccountIdentification + */ + +public class IbanAccountIdentification { + public static final String SERIALIZED_NAME_IBAN = "iban"; + @SerializedName(SERIALIZED_NAME_IBAN) + private String iban; + + /** + * **iban** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + IBAN("iban"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.IBAN; + + public IbanAccountIdentification() { + } + + public IbanAccountIdentification iban(String iban) { + + this.iban = iban; + return this; + } + + /** + * The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * @return iban + **/ + @ApiModelProperty(required = true, value = "The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard.") + + public String getIban() { + return iban; + } + + + public void setIban(String iban) { + this.iban = iban; + } + + + public IbanAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **iban** + * @return type + **/ + @ApiModelProperty(required = true, value = "**iban**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IbanAccountIdentification ibanAccountIdentification = (IbanAccountIdentification) o; + return Objects.equals(this.iban, ibanAccountIdentification.iban) && + Objects.equals(this.type, ibanAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(iban, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IbanAccountIdentification {\n"); + sb.append(" iban: ").append(toIndentedString(iban)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("iban"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("iban"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IbanAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (IbanAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in IbanAccountIdentification is not found in the empty JSON string", IbanAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IbanAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IbanAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IbanAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field iban + if (jsonObj.get("iban") != null && !jsonObj.get("iban").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `iban` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iban").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!IbanAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IbanAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IbanAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, IbanAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public IbanAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IbanAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of IbanAccountIdentification + * @throws IOException if the JSON string is invalid with respect to IbanAccountIdentification + */ + public static IbanAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IbanAccountIdentification.class); + } + + /** + * Convert an instance of IbanAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java b/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java index 06bfdc508..a260e9fee 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Individual.java b/src/main/java/com/adyen/model/legalentitymanagement/Individual.java index 621b1e9a4..517cfb6ff 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Individual.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Individual.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/JSON.java b/src/main/java/com/adyen/model/legalentitymanagement/JSON.java index e3e73eb14..a339a3955 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/JSON.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/JSON.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -92,28 +92,39 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.AULocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.AcceptTermsOfServiceRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.AcceptTermsOfServiceResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.AdditionalBankIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.Address.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.Amount.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.Attachment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.BankAccountInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.BankAccountInfoAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.BirthData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.BusinessLine.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.BusinessLineInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.BusinessLineInfoUpdate.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.BusinessLines.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.CalculateTermsOfServiceStatusResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.CALocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.CZLocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.CapabilityProblem.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.CapabilityProblemEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.CapabilityProblemEntityRecursive.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.CapabilitySettings.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.DKLocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.Document.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.DocumentReference.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.EntityReference.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.GeneratePciDescriptionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.GeneratePciDescriptionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.GetPciQuestionnaireInfosResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.GetPciQuestionnaireResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.GetTermsOfServiceAcceptanceInfosResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.GetTermsOfServiceDocumentRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.GetTermsOfServiceDocumentResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.HULocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.IbanAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.IdentificationData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.Individual.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.LegalEntity.CustomTypeAdapterFactory()); @@ -121,15 +132,22 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.LegalEntityCapability.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.LegalEntityInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.LegalEntityInfoRequiredType.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.NOLocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.Name.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.NumberAndBicAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.OnboardingLink.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.OnboardingLinkInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.OnboardingTheme.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.OnboardingThemes.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.Organization.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.OwnerEntity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.PLLocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.PciDocumentInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.PciSigningRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.PciSigningResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.PhoneNumber.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.RemediatingAction.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.SELocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.ServiceError.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.SoleProprietorship.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.SourceOfFunds.CustomTypeAdapterFactory()); @@ -141,8 +159,11 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.TransferInstrument.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.TransferInstrumentInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.TransferInstrumentReference.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.UKLocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.USLocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.VerificationError.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.VerificationErrorRecursive.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.VerificationErrors.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.WebData.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.legalentitymanagement.WebDataExemption.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java index 0c9451135..9580e0b53 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.adyen.model.legalentitymanagement.CapabilityProblem; import com.adyen.model.legalentitymanagement.DocumentReference; import com.adyen.model.legalentitymanagement.EntityReference; import com.adyen.model.legalentitymanagement.Individual; @@ -88,6 +89,10 @@ public class LegalEntity { @SerializedName(SERIALIZED_NAME_ORGANIZATION) private Organization organization; + public static final String SERIALIZED_NAME_PROBLEMS = "problems"; + @SerializedName(SERIALIZED_NAME_PROBLEMS) + private List problems = null; + public static final String SERIALIZED_NAME_REFERENCE = "reference"; @SerializedName(SERIALIZED_NAME_REFERENCE) private String reference; @@ -334,6 +339,36 @@ public void setOrganization(Organization organization) { } + public LegalEntity problems(List problems) { + + this.problems = problems; + return this; + } + + public LegalEntity addProblemsItem(CapabilityProblem problemsItem) { + if (this.problems == null) { + this.problems = new ArrayList<>(); + } + this.problems.add(problemsItem); + return this; + } + + /** + * List of the verification errors from capabilities for the legal entity. + * @return problems + **/ + @ApiModelProperty(value = "List of the verification errors from capabilities for the legal entity.") + + public List getProblems() { + return problems; + } + + + public void setProblems(List problems) { + this.problems = problems; + } + + public LegalEntity reference(String reference) { this.reference = reference; @@ -430,6 +465,7 @@ public boolean equals(Object o) { Objects.equals(this.id, legalEntity.id) && Objects.equals(this.individual, legalEntity.individual) && Objects.equals(this.organization, legalEntity.organization) && + Objects.equals(this.problems, legalEntity.problems) && Objects.equals(this.reference, legalEntity.reference) && Objects.equals(this.soleProprietorship, legalEntity.soleProprietorship) && Objects.equals(this.transferInstruments, legalEntity.transferInstruments) && @@ -438,7 +474,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(capabilities, documentDetails, documents, entityAssociations, id, individual, organization, reference, soleProprietorship, transferInstruments, type); + return Objects.hash(capabilities, documentDetails, documents, entityAssociations, id, individual, organization, problems, reference, soleProprietorship, transferInstruments, type); } @Override @@ -452,6 +488,7 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" individual: ").append(toIndentedString(individual)).append("\n"); sb.append(" organization: ").append(toIndentedString(organization)).append("\n"); + sb.append(" problems: ").append(toIndentedString(problems)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" soleProprietorship: ").append(toIndentedString(soleProprietorship)).append("\n"); sb.append(" transferInstruments: ").append(toIndentedString(transferInstruments)).append("\n"); @@ -485,6 +522,7 @@ private String toIndentedString(Object o) { openapiFields.add("id"); openapiFields.add("individual"); openapiFields.add("organization"); + openapiFields.add("problems"); openapiFields.add("reference"); openapiFields.add("soleProprietorship"); openapiFields.add("transferInstruments"); @@ -572,6 +610,18 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.getAsJsonObject("organization") != null) { Organization.validateJsonObject(jsonObj.getAsJsonObject("organization")); } + JsonArray jsonArrayproblems = jsonObj.getAsJsonArray("problems"); + if (jsonArrayproblems != null) { + // ensure the json data is an array + if (!jsonObj.get("problems").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `problems` to be an array in the JSON string but got `%s`", jsonObj.get("problems").toString())); + } + + // validate the optional field `problems` (array) + for (int i = 0; i < jsonArrayproblems.size(); i++) { + CapabilityProblem.validateJsonObject(jsonArrayproblems.get(i).getAsJsonObject()); + }; + } // validate the optional field reference if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java index 7a5123ba0..537c8fb7c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java index b08ac2057..38c9315c0 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -14,7 +14,6 @@ import java.util.Objects; import java.util.Arrays; -import com.adyen.model.legalentitymanagement.CapabilityProblem; import com.adyen.model.legalentitymanagement.CapabilitySettings; import com.adyen.model.legalentitymanagement.SupportingEntityCapability; import com.google.gson.TypeAdapter; @@ -116,10 +115,6 @@ public AllowedLevelEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ALLOWED_SETTINGS) private CapabilitySettings allowedSettings; - public static final String SERIALIZED_NAME_PROBLEMS = "problems"; - @SerializedName(SERIALIZED_NAME_PROBLEMS) - private List problems = null; - public static final String SERIALIZED_NAME_REQUESTED = "requested"; @SerializedName(SERIALIZED_NAME_REQUESTED) private Boolean requested; @@ -198,7 +193,6 @@ public LegalEntityCapability() { public LegalEntityCapability( Boolean allowed, AllowedLevelEnum allowedLevel, - List problems, Boolean requested, RequestedLevelEnum requestedLevel, List transferInstruments, @@ -207,7 +201,6 @@ public LegalEntityCapability( this(); this.allowed = allowed; this.allowedLevel = allowedLevel; - this.problems = problems; this.requested = requested; this.requestedLevel = requestedLevel; this.transferInstruments = transferInstruments; @@ -262,19 +255,6 @@ public void setAllowedSettings(CapabilitySettings allowedSettings) { } - /** - * Contains verification errors and the actions that you can take to resolve them. - * @return problems - **/ - @ApiModelProperty(value = "Contains verification errors and the actions that you can take to resolve them.") - - public List getProblems() { - return problems; - } - - - - /** * Indicates whether the capability is requested. To check whether the Legal Entity is permitted to use the capability, * @return requested @@ -362,7 +342,6 @@ public boolean equals(Object o) { return Objects.equals(this.allowed, legalEntityCapability.allowed) && Objects.equals(this.allowedLevel, legalEntityCapability.allowedLevel) && Objects.equals(this.allowedSettings, legalEntityCapability.allowedSettings) && - Objects.equals(this.problems, legalEntityCapability.problems) && Objects.equals(this.requested, legalEntityCapability.requested) && Objects.equals(this.requestedLevel, legalEntityCapability.requestedLevel) && Objects.equals(this.requestedSettings, legalEntityCapability.requestedSettings) && @@ -372,7 +351,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(allowed, allowedLevel, allowedSettings, problems, requested, requestedLevel, requestedSettings, transferInstruments, verificationStatus); + return Objects.hash(allowed, allowedLevel, allowedSettings, requested, requestedLevel, requestedSettings, transferInstruments, verificationStatus); } @Override @@ -382,7 +361,6 @@ public String toString() { sb.append(" allowed: ").append(toIndentedString(allowed)).append("\n"); sb.append(" allowedLevel: ").append(toIndentedString(allowedLevel)).append("\n"); sb.append(" allowedSettings: ").append(toIndentedString(allowedSettings)).append("\n"); - sb.append(" problems: ").append(toIndentedString(problems)).append("\n"); sb.append(" requested: ").append(toIndentedString(requested)).append("\n"); sb.append(" requestedLevel: ").append(toIndentedString(requestedLevel)).append("\n"); sb.append(" requestedSettings: ").append(toIndentedString(requestedSettings)).append("\n"); @@ -413,7 +391,6 @@ private String toIndentedString(Object o) { openapiFields.add("allowed"); openapiFields.add("allowedLevel"); openapiFields.add("allowedSettings"); - openapiFields.add("problems"); openapiFields.add("requested"); openapiFields.add("requestedLevel"); openapiFields.add("requestedSettings"); @@ -457,18 +434,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.getAsJsonObject("allowedSettings") != null) { CapabilitySettings.validateJsonObject(jsonObj.getAsJsonObject("allowedSettings")); } - JsonArray jsonArrayproblems = jsonObj.getAsJsonArray("problems"); - if (jsonArrayproblems != null) { - // ensure the json data is an array - if (!jsonObj.get("problems").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `problems` to be an array in the JSON string but got `%s`", jsonObj.get("problems").toString())); - } - - // validate the optional field `problems` (array) - for (int i = 0; i < jsonArrayproblems.size(); i++) { - CapabilityProblem.validateJsonObject(jsonArrayproblems.get(i).getAsJsonObject()); - }; - } // ensure the field requestedLevel can be parsed to an enum value if (jsonObj.get("requestedLevel") != null) { if(!jsonObj.get("requestedLevel").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java index 82fd3cf72..fbeb60ff3 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java index f33f57f51..badada7ec 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java new file mode 100644 index 000000000..5b2d8a3ab --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java @@ -0,0 +1,298 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * NOLocalAccountIdentification + */ + +public class NOLocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + /** + * **noLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + NOLOCAL("noLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.NOLOCAL; + + public NOLocalAccountIdentification() { + } + + public NOLocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 11-digit bank account number, without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 11-digit bank account number, without separators or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public NOLocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **noLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**noLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NOLocalAccountIdentification noLocalAccountIdentification = (NOLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, noLocalAccountIdentification.accountNumber) && + Objects.equals(this.type, noLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NOLocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NOLocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NOLocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NOLocalAccountIdentification is not found in the empty JSON string", NOLocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NOLocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NOLocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NOLocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NOLocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NOLocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NOLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NOLocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NOLocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NOLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of NOLocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to NOLocalAccountIdentification + */ + public static NOLocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NOLocalAccountIdentification.class); + } + + /** + * Convert an instance of NOLocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Name.java b/src/main/java/com/adyen/model/legalentitymanagement/Name.java index 1685a4f09..e97ae9d54 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Name.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Name.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/NumberAndBicAccountIdentification.java new file mode 100644 index 000000000..9d6cd9e68 --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/NumberAndBicAccountIdentification.java @@ -0,0 +1,366 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.legalentitymanagement.AdditionalBankIdentification; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * NumberAndBicAccountIdentification + */ + +public class NumberAndBicAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_ADDITIONAL_BANK_IDENTIFICATION = "additionalBankIdentification"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_BANK_IDENTIFICATION) + private AdditionalBankIdentification additionalBankIdentification; + + public static final String SERIALIZED_NAME_BIC = "bic"; + @SerializedName(SERIALIZED_NAME_BIC) + private String bic; + + /** + * **numberAndBic** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + NUMBERANDBIC("numberAndBic"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.NUMBERANDBIC; + + public NumberAndBicAccountIdentification() { + } + + public NumberAndBicAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The bank account number, without separators or whitespace. The length and format depends on the bank or country. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The bank account number, without separators or whitespace. The length and format depends on the bank or country.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public NumberAndBicAccountIdentification additionalBankIdentification(AdditionalBankIdentification additionalBankIdentification) { + + this.additionalBankIdentification = additionalBankIdentification; + return this; + } + + /** + * Get additionalBankIdentification + * @return additionalBankIdentification + **/ + @ApiModelProperty(value = "") + + public AdditionalBankIdentification getAdditionalBankIdentification() { + return additionalBankIdentification; + } + + + public void setAdditionalBankIdentification(AdditionalBankIdentification additionalBankIdentification) { + this.additionalBankIdentification = additionalBankIdentification; + } + + + public NumberAndBicAccountIdentification bic(String bic) { + + this.bic = bic; + return this; + } + + /** + * The bank's 8- or 11-character BIC or SWIFT code. + * @return bic + **/ + @ApiModelProperty(required = true, value = "The bank's 8- or 11-character BIC or SWIFT code.") + + public String getBic() { + return bic; + } + + + public void setBic(String bic) { + this.bic = bic; + } + + + public NumberAndBicAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **numberAndBic** + * @return type + **/ + @ApiModelProperty(required = true, value = "**numberAndBic**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberAndBicAccountIdentification numberAndBicAccountIdentification = (NumberAndBicAccountIdentification) o; + return Objects.equals(this.accountNumber, numberAndBicAccountIdentification.accountNumber) && + Objects.equals(this.additionalBankIdentification, numberAndBicAccountIdentification.additionalBankIdentification) && + Objects.equals(this.bic, numberAndBicAccountIdentification.bic) && + Objects.equals(this.type, numberAndBicAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, additionalBankIdentification, bic, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberAndBicAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" additionalBankIdentification: ").append(toIndentedString(additionalBankIdentification)).append("\n"); + sb.append(" bic: ").append(toIndentedString(bic)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("additionalBankIdentification"); + openapiFields.add("bic"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("bic"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NumberAndBicAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NumberAndBicAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NumberAndBicAccountIdentification is not found in the empty JSON string", NumberAndBicAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NumberAndBicAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NumberAndBicAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : NumberAndBicAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // validate the optional field `additionalBankIdentification` + if (jsonObj.getAsJsonObject("additionalBankIdentification") != null) { + AdditionalBankIdentification.validateJsonObject(jsonObj.getAsJsonObject("additionalBankIdentification")); + } + // validate the optional field bic + if (jsonObj.get("bic") != null && !jsonObj.get("bic").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bic` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bic").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NumberAndBicAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NumberAndBicAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NumberAndBicAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NumberAndBicAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NumberAndBicAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NumberAndBicAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of NumberAndBicAccountIdentification + * @throws IOException if the JSON string is invalid with respect to NumberAndBicAccountIdentification + */ + public static NumberAndBicAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NumberAndBicAccountIdentification.class); + } + + /** + * Convert an instance of NumberAndBicAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java index 07f92bd4f..a02eed945 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java index 01e697f0d..508fe939f 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java index 4d030de62..da010f203 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java index c07035cb2..248dc9cfb 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Organization.java b/src/main/java/com/adyen/model/legalentitymanagement/Organization.java index 338ae826b..5482f7982 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Organization.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Organization.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java index 30a2acaa9..82da1c073 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java new file mode 100644 index 000000000..22763950c --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java @@ -0,0 +1,298 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * PLLocalAccountIdentification + */ + +public class PLLocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + /** + * **plLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + PLLOCAL("plLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.PLLOCAL; + + public PLLocalAccountIdentification() { + } + + public PLLocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 26-digit bank account number ([Numer rachunku](https://pl.wikipedia.org/wiki/Numer_Rachunku_Bankowego)), without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 26-digit bank account number ([Numer rachunku](https://pl.wikipedia.org/wiki/Numer_Rachunku_Bankowego)), without separators or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public PLLocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **plLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**plLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PLLocalAccountIdentification plLocalAccountIdentification = (PLLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, plLocalAccountIdentification.accountNumber) && + Objects.equals(this.type, plLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PLLocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PLLocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PLLocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PLLocalAccountIdentification is not found in the empty JSON string", PLLocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PLLocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PLLocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PLLocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PLLocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PLLocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PLLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PLLocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PLLocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PLLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of PLLocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to PLLocalAccountIdentification + */ + public static PLLocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PLLocalAccountIdentification.class); + } + + /** + * Convert an instance of PLLocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java new file mode 100644 index 000000000..8c52093b6 --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java @@ -0,0 +1,267 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * PciDocumentInfo + */ + +public class PciDocumentInfo { + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_VALID_UNTIL = "validUntil"; + @SerializedName(SERIALIZED_NAME_VALID_UNTIL) + private OffsetDateTime validUntil; + + public PciDocumentInfo() { + } + + public PciDocumentInfo createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The date the questionnaire was created, in ISO 8601 extended format. For example, 2022-12-18T10:15:30+01:00 + * @return createdAt + **/ + @ApiModelProperty(value = "The date the questionnaire was created, in ISO 8601 extended format. For example, 2022-12-18T10:15:30+01:00") + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public PciDocumentInfo id(String id) { + + this.id = id; + return this; + } + + /** + * The unique identifier of the signed questionnaire. + * @return id + **/ + @ApiModelProperty(value = "The unique identifier of the signed questionnaire.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public PciDocumentInfo validUntil(OffsetDateTime validUntil) { + + this.validUntil = validUntil; + return this; + } + + /** + * The expiration date of the questionnaire, in ISO 8601 extended format. For example, 2022-12-18T10:15:30+01:00 + * @return validUntil + **/ + @ApiModelProperty(value = "The expiration date of the questionnaire, in ISO 8601 extended format. For example, 2022-12-18T10:15:30+01:00") + + public OffsetDateTime getValidUntil() { + return validUntil; + } + + + public void setValidUntil(OffsetDateTime validUntil) { + this.validUntil = validUntil; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PciDocumentInfo pciDocumentInfo = (PciDocumentInfo) o; + return Objects.equals(this.createdAt, pciDocumentInfo.createdAt) && + Objects.equals(this.id, pciDocumentInfo.id) && + Objects.equals(this.validUntil, pciDocumentInfo.validUntil); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, id, validUntil); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PciDocumentInfo {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" validUntil: ").append(toIndentedString(validUntil)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("createdAt"); + openapiFields.add("id"); + openapiFields.add("validUntil"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PciDocumentInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PciDocumentInfo.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PciDocumentInfo is not found in the empty JSON string", PciDocumentInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PciDocumentInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PciDocumentInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PciDocumentInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PciDocumentInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PciDocumentInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PciDocumentInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PciDocumentInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PciDocumentInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of PciDocumentInfo + * @throws IOException if the JSON string is invalid with respect to PciDocumentInfo + */ + public static PciDocumentInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PciDocumentInfo.class); + } + + /** + * Convert an instance of PciDocumentInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java new file mode 100644 index 000000000..6f8192242 --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java @@ -0,0 +1,257 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * PciSigningRequest + */ + +public class PciSigningRequest { + public static final String SERIALIZED_NAME_PCI_TEMPLATE_REFERENCES = "pciTemplateReferences"; + @SerializedName(SERIALIZED_NAME_PCI_TEMPLATE_REFERENCES) + private List pciTemplateReferences = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SIGNED_BY = "signedBy"; + @SerializedName(SERIALIZED_NAME_SIGNED_BY) + private String signedBy; + + public PciSigningRequest() { + } + + public PciSigningRequest pciTemplateReferences(List pciTemplateReferences) { + + this.pciTemplateReferences = pciTemplateReferences; + return this; + } + + public PciSigningRequest addPciTemplateReferencesItem(String pciTemplateReferencesItem) { + this.pciTemplateReferences.add(pciTemplateReferencesItem); + return this; + } + + /** + * The array of Adyen-generated unique identifiers for the questionnaires. + * @return pciTemplateReferences + **/ + @ApiModelProperty(required = true, value = "The array of Adyen-generated unique identifiers for the questionnaires.") + + public List getPciTemplateReferences() { + return pciTemplateReferences; + } + + + public void setPciTemplateReferences(List pciTemplateReferences) { + this.pciTemplateReferences = pciTemplateReferences; + } + + + public PciSigningRequest signedBy(String signedBy) { + + this.signedBy = signedBy; + return this; + } + + /** + * The [legal entity ID](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) of the individual who signs the PCI questionnaire. + * @return signedBy + **/ + @ApiModelProperty(required = true, value = "The [legal entity ID](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) of the individual who signs the PCI questionnaire.") + + public String getSignedBy() { + return signedBy; + } + + + public void setSignedBy(String signedBy) { + this.signedBy = signedBy; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PciSigningRequest pciSigningRequest = (PciSigningRequest) o; + return Objects.equals(this.pciTemplateReferences, pciSigningRequest.pciTemplateReferences) && + Objects.equals(this.signedBy, pciSigningRequest.signedBy); + } + + @Override + public int hashCode() { + return Objects.hash(pciTemplateReferences, signedBy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PciSigningRequest {\n"); + sb.append(" pciTemplateReferences: ").append(toIndentedString(pciTemplateReferences)).append("\n"); + sb.append(" signedBy: ").append(toIndentedString(signedBy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pciTemplateReferences"); + openapiFields.add("signedBy"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pciTemplateReferences"); + openapiRequiredFields.add("signedBy"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PciSigningRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PciSigningRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PciSigningRequest is not found in the empty JSON string", PciSigningRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PciSigningRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PciSigningRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PciSigningRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("pciTemplateReferences") != null && !jsonObj.get("pciTemplateReferences").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pciTemplateReferences` to be an array in the JSON string but got `%s`", jsonObj.get("pciTemplateReferences").toString())); + } + // validate the optional field signedBy + if (jsonObj.get("signedBy") != null && !jsonObj.get("signedBy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signedBy").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PciSigningRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PciSigningRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PciSigningRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PciSigningRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PciSigningRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PciSigningRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of PciSigningRequest + * @throws IOException if the JSON string is invalid with respect to PciSigningRequest + */ + public static PciSigningRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PciSigningRequest.class); + } + + /** + * Convert an instance of PciSigningRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java new file mode 100644 index 000000000..73ad427f9 --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java @@ -0,0 +1,251 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * PciSigningResponse + */ + +public class PciSigningResponse { + public static final String SERIALIZED_NAME_PCI_QUESTIONNAIRE_IDS = "pciQuestionnaireIds"; + @SerializedName(SERIALIZED_NAME_PCI_QUESTIONNAIRE_IDS) + private List pciQuestionnaireIds = null; + + public static final String SERIALIZED_NAME_SIGNED_BY = "signedBy"; + @SerializedName(SERIALIZED_NAME_SIGNED_BY) + private String signedBy; + + public PciSigningResponse() { + } + + public PciSigningResponse pciQuestionnaireIds(List pciQuestionnaireIds) { + + this.pciQuestionnaireIds = pciQuestionnaireIds; + return this; + } + + public PciSigningResponse addPciQuestionnaireIdsItem(String pciQuestionnaireIdsItem) { + if (this.pciQuestionnaireIds == null) { + this.pciQuestionnaireIds = new ArrayList<>(); + } + this.pciQuestionnaireIds.add(pciQuestionnaireIdsItem); + return this; + } + + /** + * The unique identifiers of the signed PCI documents. + * @return pciQuestionnaireIds + **/ + @ApiModelProperty(value = "The unique identifiers of the signed PCI documents.") + + public List getPciQuestionnaireIds() { + return pciQuestionnaireIds; + } + + + public void setPciQuestionnaireIds(List pciQuestionnaireIds) { + this.pciQuestionnaireIds = pciQuestionnaireIds; + } + + + public PciSigningResponse signedBy(String signedBy) { + + this.signedBy = signedBy; + return this; + } + + /** + * The [legal entity ID](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) of the individual who signed the PCI questionnaire. + * @return signedBy + **/ + @ApiModelProperty(value = "The [legal entity ID](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/legalEntities__resParam_id) of the individual who signed the PCI questionnaire.") + + public String getSignedBy() { + return signedBy; + } + + + public void setSignedBy(String signedBy) { + this.signedBy = signedBy; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PciSigningResponse pciSigningResponse = (PciSigningResponse) o; + return Objects.equals(this.pciQuestionnaireIds, pciSigningResponse.pciQuestionnaireIds) && + Objects.equals(this.signedBy, pciSigningResponse.signedBy); + } + + @Override + public int hashCode() { + return Objects.hash(pciQuestionnaireIds, signedBy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PciSigningResponse {\n"); + sb.append(" pciQuestionnaireIds: ").append(toIndentedString(pciQuestionnaireIds)).append("\n"); + sb.append(" signedBy: ").append(toIndentedString(signedBy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pciQuestionnaireIds"); + openapiFields.add("signedBy"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PciSigningResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PciSigningResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PciSigningResponse is not found in the empty JSON string", PciSigningResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PciSigningResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PciSigningResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("pciQuestionnaireIds") != null && !jsonObj.get("pciQuestionnaireIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pciQuestionnaireIds` to be an array in the JSON string but got `%s`", jsonObj.get("pciQuestionnaireIds").toString())); + } + // validate the optional field signedBy + if (jsonObj.get("signedBy") != null && !jsonObj.get("signedBy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signedBy").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PciSigningResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PciSigningResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PciSigningResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PciSigningResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PciSigningResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PciSigningResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PciSigningResponse + * @throws IOException if the JSON string is invalid with respect to PciSigningResponse + */ + public static PciSigningResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PciSigningResponse.class); + } + + /** + * Convert an instance of PciSigningResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java b/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java index 4b97de1de..74b6de7f9 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java b/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java index 8ddd07965..16c6764a1 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java new file mode 100644 index 000000000..9796c0971 --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java @@ -0,0 +1,332 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * SELocalAccountIdentification + */ + +public class SELocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_CLEARING_NUMBER = "clearingNumber"; + @SerializedName(SERIALIZED_NAME_CLEARING_NUMBER) + private String clearingNumber; + + /** + * **seLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + SELOCAL("seLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.SELOCAL; + + public SELocalAccountIdentification() { + } + + public SELocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 7- to 10-digit bank account number ([Bankkontonummer](https://sv.wikipedia.org/wiki/Bankkonto)), without the clearing number, separators, or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 7- to 10-digit bank account number ([Bankkontonummer](https://sv.wikipedia.org/wiki/Bankkonto)), without the clearing number, separators, or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public SELocalAccountIdentification clearingNumber(String clearingNumber) { + + this.clearingNumber = clearingNumber; + return this; + } + + /** + * The 4- to 5-digit clearing number ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or whitespace. + * @return clearingNumber + **/ + @ApiModelProperty(required = true, value = "The 4- to 5-digit clearing number ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or whitespace.") + + public String getClearingNumber() { + return clearingNumber; + } + + + public void setClearingNumber(String clearingNumber) { + this.clearingNumber = clearingNumber; + } + + + public SELocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **seLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**seLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SELocalAccountIdentification seLocalAccountIdentification = (SELocalAccountIdentification) o; + return Objects.equals(this.accountNumber, seLocalAccountIdentification.accountNumber) && + Objects.equals(this.clearingNumber, seLocalAccountIdentification.clearingNumber) && + Objects.equals(this.type, seLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, clearingNumber, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SELocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" clearingNumber: ").append(toIndentedString(clearingNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("clearingNumber"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("clearingNumber"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SELocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SELocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SELocalAccountIdentification is not found in the empty JSON string", SELocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SELocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SELocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SELocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // validate the optional field clearingNumber + if (jsonObj.get("clearingNumber") != null && !jsonObj.get("clearingNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clearingNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clearingNumber").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SELocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SELocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SELocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SELocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SELocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SELocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of SELocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to SELocalAccountIdentification + */ + public static SELocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SELocalAccountIdentification.class); + } + + /** + * Convert an instance of SELocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java b/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java index 293b06fb1..f4e5d64d1 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java b/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java index 1459a536a..81fd31425 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java b/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java index fbca93d5b..1cb74c144 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -121,7 +121,9 @@ public SourceOfFunds acquiringBusinessLineId(String acquiringBusinessLineId) { /** * The unique identifier of the business line that will be the source of funds.This must be a business line for a **receivePayments** or **receiveFromPlatformPayments** capability. * @return acquiringBusinessLineId + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The unique identifier of the business line that will be the source of funds.This must be a business line for a **receivePayments** or **receiveFromPlatformPayments** capability.") public String getAcquiringBusinessLineId() { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/StockData.java b/src/main/java/com/adyen/model/legalentitymanagement/StockData.java index 60fe20038..08b4342d7 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/StockData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/StockData.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java b/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java index b5377cf78..87bbff865 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java b/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java index 67cb499ff..083d8d099 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java b/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java index 3e2cbca9a..daf26b6a3 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java index 31f101446..831ab379a 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java index 068e3f257..54795dca9 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -15,7 +15,9 @@ import java.util.Objects; import java.util.Arrays; import com.adyen.model.legalentitymanagement.BankAccountInfo; +import com.adyen.model.legalentitymanagement.CapabilityProblem; import com.adyen.model.legalentitymanagement.DocumentReference; +import com.adyen.model.legalentitymanagement.SupportingEntityCapability; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -25,7 +27,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -56,6 +60,10 @@ public class TransferInstrument { @SerializedName(SERIALIZED_NAME_BANK_ACCOUNT) private BankAccountInfo bankAccount; + public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; + @SerializedName(SERIALIZED_NAME_CAPABILITIES) + private Map capabilities = null; + public static final String SERIALIZED_NAME_DOCUMENT_DETAILS = "documentDetails"; @SerializedName(SERIALIZED_NAME_DOCUMENT_DETAILS) private List documentDetails = null; @@ -68,6 +76,10 @@ public class TransferInstrument { @SerializedName(SERIALIZED_NAME_LEGAL_ENTITY_ID) private String legalEntityId; + public static final String SERIALIZED_NAME_PROBLEMS = "problems"; + @SerializedName(SERIALIZED_NAME_PROBLEMS) + private List problems = null; + /** * The type of transfer instrument. Possible value: **bankAccount**. */ @@ -152,6 +164,36 @@ public void setBankAccount(BankAccountInfo bankAccount) { } + public TransferInstrument capabilities(Map capabilities) { + + this.capabilities = capabilities; + return this; + } + + public TransferInstrument putCapabilitiesItem(String key, SupportingEntityCapability capabilitiesItem) { + if (this.capabilities == null) { + this.capabilities = new HashMap<>(); + } + this.capabilities.put(key, capabilitiesItem); + return this; + } + + /** + * List of capabilities for this supporting entity. + * @return capabilities + **/ + @ApiModelProperty(value = "List of capabilities for this supporting entity.") + + public Map getCapabilities() { + return capabilities; + } + + + public void setCapabilities(Map capabilities) { + this.capabilities = capabilities; + } + + public TransferInstrument documentDetails(List documentDetails) { this.documentDetails = documentDetails; @@ -217,6 +259,36 @@ public void setLegalEntityId(String legalEntityId) { } + public TransferInstrument problems(List problems) { + + this.problems = problems; + return this; + } + + public TransferInstrument addProblemsItem(CapabilityProblem problemsItem) { + if (this.problems == null) { + this.problems = new ArrayList<>(); + } + this.problems.add(problemsItem); + return this; + } + + /** + * List of the verification errors from capabilities for this supporting entity. + * @return problems + **/ + @ApiModelProperty(value = "List of the verification errors from capabilities for this supporting entity.") + + public List getProblems() { + return problems; + } + + + public void setProblems(List problems) { + this.problems = problems; + } + + public TransferInstrument type(TypeEnum type) { this.type = type; @@ -250,15 +322,17 @@ public boolean equals(Object o) { } TransferInstrument transferInstrument = (TransferInstrument) o; return Objects.equals(this.bankAccount, transferInstrument.bankAccount) && + Objects.equals(this.capabilities, transferInstrument.capabilities) && Objects.equals(this.documentDetails, transferInstrument.documentDetails) && Objects.equals(this.id, transferInstrument.id) && Objects.equals(this.legalEntityId, transferInstrument.legalEntityId) && + Objects.equals(this.problems, transferInstrument.problems) && Objects.equals(this.type, transferInstrument.type); } @Override public int hashCode() { - return Objects.hash(bankAccount, documentDetails, id, legalEntityId, type); + return Objects.hash(bankAccount, capabilities, documentDetails, id, legalEntityId, problems, type); } @Override @@ -266,9 +340,11 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TransferInstrument {\n"); sb.append(" bankAccount: ").append(toIndentedString(bankAccount)).append("\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); sb.append(" documentDetails: ").append(toIndentedString(documentDetails)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" legalEntityId: ").append(toIndentedString(legalEntityId)).append("\n"); + sb.append(" problems: ").append(toIndentedString(problems)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); @@ -293,9 +369,11 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("bankAccount"); + openapiFields.add("capabilities"); openapiFields.add("documentDetails"); openapiFields.add("id"); openapiFields.add("legalEntityId"); + openapiFields.add("problems"); openapiFields.add("type"); // a set of required properties/fields (JSON key names) @@ -359,6 +437,18 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("legalEntityId") != null && !jsonObj.get("legalEntityId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `legalEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legalEntityId").toString())); } + JsonArray jsonArrayproblems = jsonObj.getAsJsonArray("problems"); + if (jsonArrayproblems != null) { + // ensure the json data is an array + if (!jsonObj.get("problems").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `problems` to be an array in the JSON string but got `%s`", jsonObj.get("problems").toString())); + } + + // validate the optional field `problems` (array) + for (int i = 0; i < jsonArrayproblems.size(); i++) { + CapabilityProblem.validateJsonObject(jsonArrayproblems.get(i).getAsJsonObject()); + }; + } // ensure the field type can be parsed to an enum value if (jsonObj.get("type") != null) { if(!jsonObj.get("type").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java index ae39a734b..8f0c8f1e3 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java index 59e39a8f6..9de13b6ff 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java new file mode 100644 index 000000000..f28cbef05 --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java @@ -0,0 +1,332 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * UKLocalAccountIdentification + */ + +public class UKLocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + public static final String SERIALIZED_NAME_SORT_CODE = "sortCode"; + @SerializedName(SERIALIZED_NAME_SORT_CODE) + private String sortCode; + + /** + * **ukLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + UKLOCAL("ukLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.UKLOCAL; + + public UKLocalAccountIdentification() { + } + + public UKLocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The 8-digit bank account number, without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The 8-digit bank account number, without separators or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public UKLocalAccountIdentification sortCode(String sortCode) { + + this.sortCode = sortCode; + return this; + } + + /** + * The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + * @return sortCode + **/ + @ApiModelProperty(required = true, value = "The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace.") + + public String getSortCode() { + return sortCode; + } + + + public void setSortCode(String sortCode) { + this.sortCode = sortCode; + } + + + public UKLocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **ukLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**ukLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UKLocalAccountIdentification ukLocalAccountIdentification = (UKLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, ukLocalAccountIdentification.accountNumber) && + Objects.equals(this.sortCode, ukLocalAccountIdentification.sortCode) && + Objects.equals(this.type, ukLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, sortCode, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UKLocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" sortCode: ").append(toIndentedString(sortCode)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("sortCode"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("sortCode"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UKLocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (UKLocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in UKLocalAccountIdentification is not found in the empty JSON string", UKLocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UKLocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UKLocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UKLocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // validate the optional field sortCode + if (jsonObj.get("sortCode") != null && !jsonObj.get("sortCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sortCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sortCode").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UKLocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UKLocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UKLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UKLocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UKLocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UKLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of UKLocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to UKLocalAccountIdentification + */ + public static UKLocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UKLocalAccountIdentification.class); + } + + /** + * Convert an instance of UKLocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java new file mode 100644 index 000000000..ecc8175c4 --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java @@ -0,0 +1,415 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * USLocalAccountIdentification + */ + +public class USLocalAccountIdentification { + public static final String SERIALIZED_NAME_ACCOUNT_NUMBER = "accountNumber"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NUMBER) + private String accountNumber; + + /** + * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + */ + @JsonAdapter(AccountTypeEnum.Adapter.class) + public enum AccountTypeEnum { + CHECKING("checking"), + + SAVINGS("savings"); + + private String value; + + AccountTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AccountTypeEnum fromValue(String value) { + for (AccountTypeEnum b : AccountTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AccountTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AccountTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AccountTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_ACCOUNT_TYPE = "accountType"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_TYPE) + private AccountTypeEnum accountType = AccountTypeEnum.CHECKING; + + public static final String SERIALIZED_NAME_ROUTING_NUMBER = "routingNumber"; + @SerializedName(SERIALIZED_NAME_ROUTING_NUMBER) + private String routingNumber; + + /** + * **usLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + USLOCAL("usLocal"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.USLOCAL; + + public USLocalAccountIdentification() { + } + + public USLocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The bank account number, without separators or whitespace. + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The bank account number, without separators or whitespace.") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public USLocalAccountIdentification accountType(AccountTypeEnum accountType) { + + this.accountType = accountType; + return this; + } + + /** + * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * @return accountType + **/ + @ApiModelProperty(value = "The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**.") + + public AccountTypeEnum getAccountType() { + return accountType; + } + + + public void setAccountType(AccountTypeEnum accountType) { + this.accountType = accountType; + } + + + public USLocalAccountIdentification routingNumber(String routingNumber) { + + this.routingNumber = routingNumber; + return this; + } + + /** + * The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + * @return routingNumber + **/ + @ApiModelProperty(required = true, value = "The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace.") + + public String getRoutingNumber() { + return routingNumber; + } + + + public void setRoutingNumber(String routingNumber) { + this.routingNumber = routingNumber; + } + + + public USLocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **usLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**usLocal**") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + USLocalAccountIdentification usLocalAccountIdentification = (USLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, usLocalAccountIdentification.accountNumber) && + Objects.equals(this.accountType, usLocalAccountIdentification.accountType) && + Objects.equals(this.routingNumber, usLocalAccountIdentification.routingNumber) && + Objects.equals(this.type, usLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, accountType, routingNumber, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class USLocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); + sb.append(" routingNumber: ").append(toIndentedString(routingNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountNumber"); + openapiFields.add("accountType"); + openapiFields.add("routingNumber"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("routingNumber"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to USLocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (USLocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in USLocalAccountIdentification is not found in the empty JSON string", USLocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!USLocalAccountIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `USLocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : USLocalAccountIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountNumber + if (jsonObj.get("accountNumber") != null && !jsonObj.get("accountNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountNumber").toString())); + } + // ensure the field accountType can be parsed to an enum value + if (jsonObj.get("accountType") != null) { + if(!jsonObj.get("accountType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountType").toString())); + } + AccountTypeEnum.fromValue(jsonObj.get("accountType").getAsString()); + } + // validate the optional field routingNumber + if (jsonObj.get("routingNumber") != null && !jsonObj.get("routingNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `routingNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("routingNumber").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!USLocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'USLocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(USLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, USLocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public USLocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of USLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of USLocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to USLocalAccountIdentification + */ + public static USLocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, USLocalAccountIdentification.class); + } + + /** + * Convert an instance of USLocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java index 1f4f351ff..0a7ffb640 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java index 1d0dd7b10..124ddb824 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java new file mode 100644 index 000000000..2ce149034 --- /dev/null +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java @@ -0,0 +1,227 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.legalentitymanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.legalentitymanagement.CapabilityProblem; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.legalentitymanagement.JSON; + +/** + * VerificationErrors + */ + +public class VerificationErrors { + public static final String SERIALIZED_NAME_PROBLEMS = "problems"; + @SerializedName(SERIALIZED_NAME_PROBLEMS) + private List problems = null; + + public VerificationErrors() { + } + + public VerificationErrors problems(List problems) { + + this.problems = problems; + return this; + } + + public VerificationErrors addProblemsItem(CapabilityProblem problemsItem) { + if (this.problems == null) { + this.problems = new ArrayList<>(); + } + this.problems.add(problemsItem); + return this; + } + + /** + * List of the verification errors. + * @return problems + **/ + @ApiModelProperty(value = "List of the verification errors.") + + public List getProblems() { + return problems; + } + + + public void setProblems(List problems) { + this.problems = problems; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerificationErrors verificationErrors = (VerificationErrors) o; + return Objects.equals(this.problems, verificationErrors.problems); + } + + @Override + public int hashCode() { + return Objects.hash(problems); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VerificationErrors {\n"); + sb.append(" problems: ").append(toIndentedString(problems)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("problems"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to VerificationErrors + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (VerificationErrors.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in VerificationErrors is not found in the empty JSON string", VerificationErrors.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!VerificationErrors.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VerificationErrors` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArrayproblems = jsonObj.getAsJsonArray("problems"); + if (jsonArrayproblems != null) { + // ensure the json data is an array + if (!jsonObj.get("problems").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `problems` to be an array in the JSON string but got `%s`", jsonObj.get("problems").toString())); + } + + // validate the optional field `problems` (array) + for (int i = 0; i < jsonArrayproblems.size(); i++) { + CapabilityProblem.validateJsonObject(jsonArrayproblems.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!VerificationErrors.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VerificationErrors' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VerificationErrors.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, VerificationErrors value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public VerificationErrors read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VerificationErrors given an JSON string + * + * @param jsonString JSON string + * @return An instance of VerificationErrors + * @throws IOException if the JSON string is invalid with respect to VerificationErrors + */ + public static VerificationErrors fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VerificationErrors.class); + } + + /** + * Convert an instance of VerificationErrors to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/legalentitymanagement/WebData.java b/src/main/java/com/adyen/model/legalentitymanagement/WebData.java index c71e7ca9f..4d63fda88 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/WebData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/WebData.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java b/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java index 9950903f2..7381e768b 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java @@ -1,7 +1,7 @@ /* * Legal Entity Management API * - * The version of the OpenAPI document: 2 + * The version of the OpenAPI document: 3 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/service/legalentitymanagement/BusinessLineService.java b/src/main/java/com/adyen/service/legalentitymanagement/BusinessLineService.java index eda063234..6dd2d8eb0 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/BusinessLineService.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/BusinessLineService.java @@ -10,6 +10,9 @@ import java.io.IOException; +/** + * @deprecated replaced by {@link BusinessLinesApi} + */ public class BusinessLineService extends Service { public BusinessLineService(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/legalentitymanagement/BusinessLinesApi.java b/src/main/java/com/adyen/service/legalentitymanagement/BusinessLinesApi.java new file mode 100644 index 000000000..4a0038957 --- /dev/null +++ b/src/main/java/com/adyen/service/legalentitymanagement/BusinessLinesApi.java @@ -0,0 +1,160 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.legalentitymanagement; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.legalentitymanagement.BusinessLine; +import com.adyen.model.legalentitymanagement.BusinessLineInfo; +import com.adyen.model.legalentitymanagement.BusinessLineInfoUpdate; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class BusinessLinesApi extends Service { + private final String baseURL; + + public BusinessLinesApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://kyc-test.adyen.com/lem/v3"); + } + + /** + * Delete a business line + * + * @param id {@link String } The unique identifier of the business line to be deleted. (required) + * @throws ApiException if fails to make API call + */ + public void deleteBusinessLine(String id) throws ApiException, IOException { + deleteBusinessLine(id, null); + } + + /** + * Delete a business line + * + * @param id {@link String } The unique identifier of the business line to be deleted. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @throws ApiException if fails to make API call + */ + public void deleteBusinessLine(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/businessLines/{id}", null); + resource.request(requestBody, null, ApiConstants.HttpMethod.DELETE, pathParams); + } + + /** + * Get a business line + * + * @param id {@link String } The unique identifier of the business line. (required) + * @return {@link BusinessLine } + * @throws ApiException if fails to make API call + */ + public BusinessLine getBusinessLine(String id) throws ApiException, IOException { + return getBusinessLine(id, null); + } + + /** + * Get a business line + * + * @param id {@link String } The unique identifier of the business line. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link BusinessLine } + * @throws ApiException if fails to make API call + */ + public BusinessLine getBusinessLine(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/businessLines/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return BusinessLine.fromJson(jsonResult); + } + + /** + * Update a business line + * + * @param id {@link String } The unique identifier of the business line. (required) + * @param businessLineInfoUpdate {@link BusinessLineInfoUpdate } (required) + * @return {@link BusinessLine } + * @throws ApiException if fails to make API call + */ + public BusinessLine updateBusinessLine(String id, BusinessLineInfoUpdate businessLineInfoUpdate) throws ApiException, IOException { + return updateBusinessLine(id, businessLineInfoUpdate, null); + } + + /** + * Update a business line + * + * @param id {@link String } The unique identifier of the business line. (required) + * @param businessLineInfoUpdate {@link BusinessLineInfoUpdate } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link BusinessLine } + * @throws ApiException if fails to make API call + */ + public BusinessLine updateBusinessLine(String id, BusinessLineInfoUpdate businessLineInfoUpdate, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = businessLineInfoUpdate.toJson(); + Resource resource = new Resource(this, this.baseURL + "/businessLines/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return BusinessLine.fromJson(jsonResult); + } + + /** + * Create a business line + * + * @param businessLineInfo {@link BusinessLineInfo } (required) + * @return {@link BusinessLine } + * @throws ApiException if fails to make API call + */ + public BusinessLine createBusinessLine(BusinessLineInfo businessLineInfo) throws ApiException, IOException { + return createBusinessLine(businessLineInfo, null); + } + + /** + * Create a business line + * + * @param businessLineInfo {@link BusinessLineInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link BusinessLine } + * @throws ApiException if fails to make API call + */ + public BusinessLine createBusinessLine(BusinessLineInfo businessLineInfo, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = businessLineInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/businessLines", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return BusinessLine.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/legalentitymanagement/Documents.java b/src/main/java/com/adyen/service/legalentitymanagement/Documents.java index db992f65f..035ab6324 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/Documents.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/Documents.java @@ -9,6 +9,9 @@ import java.io.IOException; +/** + * @deprecated replaced by {@link DocumentsApi} + */ public class Documents extends Service { public Documents(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboarding.java b/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboarding.java index 10e2c9987..a8d8223d3 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboarding.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboarding.java @@ -12,6 +12,9 @@ import java.io.IOException; +/** + * @deprecated replaced by {@link HostedOnboardingApi} + */ public class HostedOnboarding extends Service { public HostedOnboarding(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboardingApi.java b/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboardingApi.java new file mode 100644 index 000000000..dbcd163fc --- /dev/null +++ b/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboardingApi.java @@ -0,0 +1,129 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.legalentitymanagement; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.legalentitymanagement.OnboardingLink; +import com.adyen.model.legalentitymanagement.OnboardingLinkInfo; +import com.adyen.model.legalentitymanagement.OnboardingTheme; +import com.adyen.model.legalentitymanagement.OnboardingThemes; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class HostedOnboardingApi extends Service { + private final String baseURL; + + public HostedOnboardingApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://kyc-test.adyen.com/lem/v3"); + } + + /** + * Get a list of hosted onboarding page themes + * + * @return {@link OnboardingThemes } + * @throws ApiException if fails to make API call + */ + public OnboardingThemes listHostedOnboardingPageThemes() throws ApiException, IOException { + return listHostedOnboardingPageThemes(null); + } + + /** + * Get a list of hosted onboarding page themes + * + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link OnboardingThemes } + * @throws ApiException if fails to make API call + */ + public OnboardingThemes listHostedOnboardingPageThemes(RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/themes", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, null); + return OnboardingThemes.fromJson(jsonResult); + } + + /** + * Get an onboarding link theme + * + * @param id {@link String } The unique identifier of the theme (required) + * @return {@link OnboardingTheme } + * @throws ApiException if fails to make API call + */ + public OnboardingTheme getOnboardingLinkTheme(String id) throws ApiException, IOException { + return getOnboardingLinkTheme(id, null); + } + + /** + * Get an onboarding link theme + * + * @param id {@link String } The unique identifier of the theme (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link OnboardingTheme } + * @throws ApiException if fails to make API call + */ + public OnboardingTheme getOnboardingLinkTheme(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/themes/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return OnboardingTheme.fromJson(jsonResult); + } + + /** + * Get a link to an Adyen-hosted onboarding page + * + * @param id {@link String } The unique identifier of the legal entity (required) + * @param onboardingLinkInfo {@link OnboardingLinkInfo } (required) + * @return {@link OnboardingLink } + * @throws ApiException if fails to make API call + */ + public OnboardingLink getLinkToAdyenhostedOnboardingPage(String id, OnboardingLinkInfo onboardingLinkInfo) throws ApiException, IOException { + return getLinkToAdyenhostedOnboardingPage(id, onboardingLinkInfo, null); + } + + /** + * Get a link to an Adyen-hosted onboarding page + * + * @param id {@link String } The unique identifier of the legal entity (required) + * @param onboardingLinkInfo {@link OnboardingLinkInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link OnboardingLink } + * @throws ApiException if fails to make API call + */ + public OnboardingLink getLinkToAdyenhostedOnboardingPage(String id, OnboardingLinkInfo onboardingLinkInfo, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = onboardingLinkInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/onboardingLinks", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return OnboardingLink.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/legalentitymanagement/LegalEntities.java b/src/main/java/com/adyen/service/legalentitymanagement/LegalEntities.java index 068c508a0..4c2d53d2a 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/LegalEntities.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/LegalEntities.java @@ -11,6 +11,9 @@ import java.io.IOException; +/** + * @deprecated replaced by {@link LegalEntitiesApi} + */ public class LegalEntities extends Service { public LegalEntities(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/legalentitymanagement/LegalEntitiesApi.java b/src/main/java/com/adyen/service/legalentitymanagement/LegalEntitiesApi.java new file mode 100644 index 000000000..f6721c12d --- /dev/null +++ b/src/main/java/com/adyen/service/legalentitymanagement/LegalEntitiesApi.java @@ -0,0 +1,198 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.legalentitymanagement; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.legalentitymanagement.BusinessLines; +import com.adyen.model.legalentitymanagement.LegalEntity; +import com.adyen.model.legalentitymanagement.LegalEntityInfo; +import com.adyen.model.legalentitymanagement.LegalEntityInfoRequiredType; +import com.adyen.model.legalentitymanagement.VerificationErrors; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class LegalEntitiesApi extends Service { + private final String baseURL; + + public LegalEntitiesApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://kyc-test.adyen.com/lem/v3"); + } + + /** + * Get a legal entity + * + * @param id {@link String } The unique identifier of the legal entity. (required) + * @return {@link LegalEntity } + * @throws ApiException if fails to make API call + */ + public LegalEntity getLegalEntity(String id) throws ApiException, IOException { + return getLegalEntity(id, null); + } + + /** + * Get a legal entity + * + * @param id {@link String } The unique identifier of the legal entity. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link LegalEntity } + * @throws ApiException if fails to make API call + */ + public LegalEntity getLegalEntity(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return LegalEntity.fromJson(jsonResult); + } + + /** + * Get all business lines under a legal entity + * + * @param id {@link String } The unique identifier of the legal entity. (required) + * @return {@link BusinessLines } + * @throws ApiException if fails to make API call + */ + public BusinessLines getAllBusinessLinesUnderLegalEntity(String id) throws ApiException, IOException { + return getAllBusinessLinesUnderLegalEntity(id, null); + } + + /** + * Get all business lines under a legal entity + * + * @param id {@link String } The unique identifier of the legal entity. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link BusinessLines } + * @throws ApiException if fails to make API call + */ + public BusinessLines getAllBusinessLinesUnderLegalEntity(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/businessLines", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return BusinessLines.fromJson(jsonResult); + } + + /** + * Update a legal entity + * + * @param id {@link String } The unique identifier of the legal entity. (required) + * @param legalEntityInfo {@link LegalEntityInfo } (required) + * @return {@link LegalEntity } + * @throws ApiException if fails to make API call + */ + public LegalEntity updateLegalEntity(String id, LegalEntityInfo legalEntityInfo) throws ApiException, IOException { + return updateLegalEntity(id, legalEntityInfo, null); + } + + /** + * Update a legal entity + * + * @param id {@link String } The unique identifier of the legal entity. (required) + * @param legalEntityInfo {@link LegalEntityInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link LegalEntity } + * @throws ApiException if fails to make API call + */ + public LegalEntity updateLegalEntity(String id, LegalEntityInfo legalEntityInfo, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = legalEntityInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return LegalEntity.fromJson(jsonResult); + } + + /** + * Create a legal entity + * + * @param legalEntityInfoRequiredType {@link LegalEntityInfoRequiredType } (required) + * @return {@link LegalEntity } + * @throws ApiException if fails to make API call + */ + public LegalEntity createLegalEntity(LegalEntityInfoRequiredType legalEntityInfoRequiredType) throws ApiException, IOException { + return createLegalEntity(legalEntityInfoRequiredType, null); + } + + /** + * Create a legal entity + * + * @param legalEntityInfoRequiredType {@link LegalEntityInfoRequiredType } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link LegalEntity } + * @throws ApiException if fails to make API call + */ + public LegalEntity createLegalEntity(LegalEntityInfoRequiredType legalEntityInfoRequiredType, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = legalEntityInfoRequiredType.toJson(); + Resource resource = new Resource(this, this.baseURL + "/legalEntities", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return LegalEntity.fromJson(jsonResult); + } + + /** + * Check a legal entity's verification errors + * + * @param id {@link String } The unique identifier of the legal entity. (required) + * @return {@link VerificationErrors } + * @throws ApiException if fails to make API call + */ + public VerificationErrors checkLegalEntitysVerificationErrors(String id) throws ApiException, IOException { + return checkLegalEntitysVerificationErrors(id, null); + } + + /** + * Check a legal entity's verification errors + * + * @param id {@link String } The unique identifier of the legal entity. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link VerificationErrors } + * @throws ApiException if fails to make API call + */ + public VerificationErrors checkLegalEntitysVerificationErrors(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/checkVerificationErrors", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return VerificationErrors.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/legalentitymanagement/PciQuestionnairesApi.java b/src/main/java/com/adyen/service/legalentitymanagement/PciQuestionnairesApi.java new file mode 100644 index 000000000..93e2928b8 --- /dev/null +++ b/src/main/java/com/adyen/service/legalentitymanagement/PciQuestionnairesApi.java @@ -0,0 +1,180 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.legalentitymanagement; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.legalentitymanagement.GeneratePciDescriptionRequest; +import com.adyen.model.legalentitymanagement.GeneratePciDescriptionResponse; +import com.adyen.model.legalentitymanagement.GetPciQuestionnaireInfosResponse; +import com.adyen.model.legalentitymanagement.GetPciQuestionnaireResponse; +import com.adyen.model.legalentitymanagement.PciSigningRequest; +import com.adyen.model.legalentitymanagement.PciSigningResponse; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class PciQuestionnairesApi extends Service { + private final String baseURL; + + public PciQuestionnairesApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://kyc-test.adyen.com/lem/v3"); + } + + /** + * Get PCI questionnaire details + * + * @param id {@link String } The unique identifier of the legal entity to get PCI questionnaire information. (required) + * @return {@link GetPciQuestionnaireInfosResponse } + * @throws ApiException if fails to make API call + */ + public GetPciQuestionnaireInfosResponse getPciQuestionnaireDetails(String id) throws ApiException, IOException { + return getPciQuestionnaireDetails(id, null); + } + + /** + * Get PCI questionnaire details + * + * @param id {@link String } The unique identifier of the legal entity to get PCI questionnaire information. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GetPciQuestionnaireInfosResponse } + * @throws ApiException if fails to make API call + */ + public GetPciQuestionnaireInfosResponse getPciQuestionnaireDetails(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/pciQuestionnaires", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return GetPciQuestionnaireInfosResponse.fromJson(jsonResult); + } + + /** + * Get PCI questionnaire + * + * @param id {@link String } The legal entity ID of the individual who signed the PCI questionnaire. (required) + * @param pciid {@link String } The unique identifier of the signed PCI questionnaire. (required) + * @return {@link GetPciQuestionnaireResponse } + * @throws ApiException if fails to make API call + */ + public GetPciQuestionnaireResponse getPciQuestionnaire(String id, String pciid) throws ApiException, IOException { + return getPciQuestionnaire(id, pciid, null); + } + + /** + * Get PCI questionnaire + * + * @param id {@link String } The legal entity ID of the individual who signed the PCI questionnaire. (required) + * @param pciid {@link String } The unique identifier of the signed PCI questionnaire. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GetPciQuestionnaireResponse } + * @throws ApiException if fails to make API call + */ + public GetPciQuestionnaireResponse getPciQuestionnaire(String id, String pciid, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + if (pciid == null) { + throw new IllegalArgumentException("Please provide the pciid path parameter"); + } + pathParams.put("pciid", pciid); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/pciQuestionnaires/{pciid}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return GetPciQuestionnaireResponse.fromJson(jsonResult); + } + + /** + * Generate PCI questionnaire + * + * @param id {@link String } The legal entity ID of the individual who will sign the PCI questionnaire. (required) + * @param generatePciDescriptionRequest {@link GeneratePciDescriptionRequest } (required) + * @return {@link GeneratePciDescriptionResponse } + * @throws ApiException if fails to make API call + */ + public GeneratePciDescriptionResponse generatePciQuestionnaire(String id, GeneratePciDescriptionRequest generatePciDescriptionRequest) throws ApiException, IOException { + return generatePciQuestionnaire(id, generatePciDescriptionRequest, null); + } + + /** + * Generate PCI questionnaire + * + * @param id {@link String } The legal entity ID of the individual who will sign the PCI questionnaire. (required) + * @param generatePciDescriptionRequest {@link GeneratePciDescriptionRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GeneratePciDescriptionResponse } + * @throws ApiException if fails to make API call + */ + public GeneratePciDescriptionResponse generatePciQuestionnaire(String id, GeneratePciDescriptionRequest generatePciDescriptionRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = generatePciDescriptionRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/pciQuestionnaires/generatePciTemplates", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return GeneratePciDescriptionResponse.fromJson(jsonResult); + } + + /** + * Sign PCI questionnaire + * + * @param id {@link String } The legal entity ID of the individual who signed the PCI questionnaire. (required) + * @param pciSigningRequest {@link PciSigningRequest } (required) + * @return {@link PciSigningResponse } + * @throws ApiException if fails to make API call + */ + public PciSigningResponse signPciQuestionnaire(String id, PciSigningRequest pciSigningRequest) throws ApiException, IOException { + return signPciQuestionnaire(id, pciSigningRequest, null); + } + + /** + * Sign PCI questionnaire + * + * @param id {@link String } The legal entity ID of the individual who signed the PCI questionnaire. (required) + * @param pciSigningRequest {@link PciSigningRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PciSigningResponse } + * @throws ApiException if fails to make API call + */ + public PciSigningResponse signPciQuestionnaire(String id, PciSigningRequest pciSigningRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = pciSigningRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/pciQuestionnaires/signPciTemplates", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return PciSigningResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/legalentitymanagement/TermsOfServiceApi.java b/src/main/java/com/adyen/service/legalentitymanagement/TermsOfServiceApi.java new file mode 100644 index 000000000..dd43a18f8 --- /dev/null +++ b/src/main/java/com/adyen/service/legalentitymanagement/TermsOfServiceApi.java @@ -0,0 +1,146 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.legalentitymanagement; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.legalentitymanagement.AcceptTermsOfServiceRequest; +import com.adyen.model.legalentitymanagement.AcceptTermsOfServiceResponse; +import com.adyen.model.legalentitymanagement.GetTermsOfServiceAcceptanceInfosResponse; +import com.adyen.model.legalentitymanagement.GetTermsOfServiceDocumentRequest; +import com.adyen.model.legalentitymanagement.GetTermsOfServiceDocumentResponse; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class TermsOfServiceApi extends Service { + private final String baseURL; + + public TermsOfServiceApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://kyc-test.adyen.com/lem/v3"); + } + + /** + * Get Terms of Service information for a legal entity + * + * @param id {@link String } The unique identifier of the legal entity. (required) + * @return {@link GetTermsOfServiceAcceptanceInfosResponse } + * @throws ApiException if fails to make API call + */ + public GetTermsOfServiceAcceptanceInfosResponse getTermsOfServiceInformationForLegalEntity(String id) throws ApiException, IOException { + return getTermsOfServiceInformationForLegalEntity(id, null); + } + + /** + * Get Terms of Service information for a legal entity + * + * @param id {@link String } The unique identifier of the legal entity. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GetTermsOfServiceAcceptanceInfosResponse } + * @throws ApiException if fails to make API call + */ + public GetTermsOfServiceAcceptanceInfosResponse getTermsOfServiceInformationForLegalEntity(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/termsOfServiceAcceptanceInfos", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return GetTermsOfServiceAcceptanceInfosResponse.fromJson(jsonResult); + } + + /** + * Accept Terms of Service + * + * @param id {@link String } The unique identifier of the legal entity. (required) + * @param termsofservicedocumentid {@link String } The unique identifier of the Terms of Service document. (required) + * @param acceptTermsOfServiceRequest {@link AcceptTermsOfServiceRequest } (required) + * @return {@link AcceptTermsOfServiceResponse } + * @throws ApiException if fails to make API call + */ + public AcceptTermsOfServiceResponse acceptTermsOfService(String id, String termsofservicedocumentid, AcceptTermsOfServiceRequest acceptTermsOfServiceRequest) throws ApiException, IOException { + return acceptTermsOfService(id, termsofservicedocumentid, acceptTermsOfServiceRequest, null); + } + + /** + * Accept Terms of Service + * + * @param id {@link String } The unique identifier of the legal entity. (required) + * @param termsofservicedocumentid {@link String } The unique identifier of the Terms of Service document. (required) + * @param acceptTermsOfServiceRequest {@link AcceptTermsOfServiceRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AcceptTermsOfServiceResponse } + * @throws ApiException if fails to make API call + */ + public AcceptTermsOfServiceResponse acceptTermsOfService(String id, String termsofservicedocumentid, AcceptTermsOfServiceRequest acceptTermsOfServiceRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + if (termsofservicedocumentid == null) { + throw new IllegalArgumentException("Please provide the termsofservicedocumentid path parameter"); + } + pathParams.put("termsofservicedocumentid", termsofservicedocumentid); + + String requestBody = acceptTermsOfServiceRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/termsOfService/{termsofservicedocumentid}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return AcceptTermsOfServiceResponse.fromJson(jsonResult); + } + + /** + * Get Terms of Service document + * + * @param id {@link String } The unique identifier of the legal entity. (required) + * @param getTermsOfServiceDocumentRequest {@link GetTermsOfServiceDocumentRequest } (required) + * @return {@link GetTermsOfServiceDocumentResponse } + * @throws ApiException if fails to make API call + */ + public GetTermsOfServiceDocumentResponse getTermsOfServiceDocument(String id, GetTermsOfServiceDocumentRequest getTermsOfServiceDocumentRequest) throws ApiException, IOException { + return getTermsOfServiceDocument(id, getTermsOfServiceDocumentRequest, null); + } + + /** + * Get Terms of Service document + * + * @param id {@link String } The unique identifier of the legal entity. (required) + * @param getTermsOfServiceDocumentRequest {@link GetTermsOfServiceDocumentRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GetTermsOfServiceDocumentResponse } + * @throws ApiException if fails to make API call + */ + public GetTermsOfServiceDocumentResponse getTermsOfServiceDocument(String id, GetTermsOfServiceDocumentRequest getTermsOfServiceDocumentRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = getTermsOfServiceDocumentRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/legalEntities/{id}/termsOfService", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return GetTermsOfServiceDocumentResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/legalentitymanagement/TransferInstruments.java b/src/main/java/com/adyen/service/legalentitymanagement/TransferInstruments.java index ec41c0d11..f73b38199 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/TransferInstruments.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/TransferInstruments.java @@ -10,6 +10,9 @@ import java.io.IOException; +/** + * @deprecated replaced by {@link TransferInstrumentsApi} + */ public class TransferInstruments extends Service { public TransferInstruments(Client client) { super(client); diff --git a/src/main/java/com/adyen/service/legalentitymanagement/TransferInstrumentsApi.java b/src/main/java/com/adyen/service/legalentitymanagement/TransferInstrumentsApi.java new file mode 100644 index 000000000..b28f21722 --- /dev/null +++ b/src/main/java/com/adyen/service/legalentitymanagement/TransferInstrumentsApi.java @@ -0,0 +1,159 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.legalentitymanagement; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.legalentitymanagement.TransferInstrument; +import com.adyen.model.legalentitymanagement.TransferInstrumentInfo; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class TransferInstrumentsApi extends Service { + private final String baseURL; + + public TransferInstrumentsApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://kyc-test.adyen.com/lem/v3"); + } + + /** + * Delete a transfer instrument + * + * @param id {@link String } The unique identifier of the transfer instrument to be deleted. (required) + * @throws ApiException if fails to make API call + */ + public void deleteTransferInstrument(String id) throws ApiException, IOException { + deleteTransferInstrument(id, null); + } + + /** + * Delete a transfer instrument + * + * @param id {@link String } The unique identifier of the transfer instrument to be deleted. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @throws ApiException if fails to make API call + */ + public void deleteTransferInstrument(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/transferInstruments/{id}", null); + resource.request(requestBody, null, ApiConstants.HttpMethod.DELETE, pathParams); + } + + /** + * Get a transfer instrument + * + * @param id {@link String } The unique identifier of the transfer instrument. (required) + * @return {@link TransferInstrument } + * @throws ApiException if fails to make API call + */ + public TransferInstrument getTransferInstrument(String id) throws ApiException, IOException { + return getTransferInstrument(id, null); + } + + /** + * Get a transfer instrument + * + * @param id {@link String } The unique identifier of the transfer instrument. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TransferInstrument } + * @throws ApiException if fails to make API call + */ + public TransferInstrument getTransferInstrument(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/transferInstruments/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return TransferInstrument.fromJson(jsonResult); + } + + /** + * Update a transfer instrument + * + * @param id {@link String } The unique identifier of the transfer instrument. (required) + * @param transferInstrumentInfo {@link TransferInstrumentInfo } (required) + * @return {@link TransferInstrument } + * @throws ApiException if fails to make API call + */ + public TransferInstrument updateTransferInstrument(String id, TransferInstrumentInfo transferInstrumentInfo) throws ApiException, IOException { + return updateTransferInstrument(id, transferInstrumentInfo, null); + } + + /** + * Update a transfer instrument + * + * @param id {@link String } The unique identifier of the transfer instrument. (required) + * @param transferInstrumentInfo {@link TransferInstrumentInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TransferInstrument } + * @throws ApiException if fails to make API call + */ + public TransferInstrument updateTransferInstrument(String id, TransferInstrumentInfo transferInstrumentInfo, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = transferInstrumentInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/transferInstruments/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return TransferInstrument.fromJson(jsonResult); + } + + /** + * Create a transfer instrument + * + * @param transferInstrumentInfo {@link TransferInstrumentInfo } (required) + * @return {@link TransferInstrument } + * @throws ApiException if fails to make API call + */ + public TransferInstrument createTransferInstrument(TransferInstrumentInfo transferInstrumentInfo) throws ApiException, IOException { + return createTransferInstrument(transferInstrumentInfo, null); + } + + /** + * Create a transfer instrument + * + * @param transferInstrumentInfo {@link TransferInstrumentInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TransferInstrument } + * @throws ApiException if fails to make API call + */ + public TransferInstrument createTransferInstrument(TransferInstrumentInfo transferInstrumentInfo, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = transferInstrumentInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/transferInstruments", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return TransferInstrument.fromJson(jsonResult); + } +} diff --git a/src/test/java/com/adyen/LegalEntityManagementTest.java b/src/test/java/com/adyen/LegalEntityManagementTest.java index 6ee466bec..aa56c645b 100644 --- a/src/test/java/com/adyen/LegalEntityManagementTest.java +++ b/src/test/java/com/adyen/LegalEntityManagementTest.java @@ -2,73 +2,51 @@ import com.adyen.model.legalentitymanagement.BusinessLine; import com.adyen.model.legalentitymanagement.BusinessLineInfo; +import com.adyen.model.legalentitymanagement.BusinessLineInfoUpdate; import com.adyen.model.legalentitymanagement.BusinessLines; import com.adyen.model.legalentitymanagement.Document; import com.adyen.model.legalentitymanagement.LegalEntity; import com.adyen.model.legalentitymanagement.LegalEntityInfo; +import com.adyen.model.legalentitymanagement.LegalEntityInfoRequiredType; import com.adyen.model.legalentitymanagement.OnboardingLink; import com.adyen.model.legalentitymanagement.OnboardingLinkInfo; import com.adyen.model.legalentitymanagement.OnboardingTheme; import com.adyen.model.legalentitymanagement.OnboardingThemes; import com.adyen.model.legalentitymanagement.TransferInstrument; import com.adyen.model.legalentitymanagement.TransferInstrumentInfo; -import com.adyen.service.legalentitymanagement.BusinessLineService; +import com.adyen.service.legalentitymanagement.BusinessLinesApi; import com.adyen.service.legalentitymanagement.Documents; -import com.adyen.service.legalentitymanagement.HostedOnboarding; -import com.adyen.service.legalentitymanagement.LegalEntities; -import com.adyen.service.legalentitymanagement.TransferInstruments; +import com.adyen.service.legalentitymanagement.HostedOnboardingApi; +import com.adyen.service.legalentitymanagement.LegalEntitiesApi; +import com.adyen.service.legalentitymanagement.TransferInstrumentsApi; import org.junit.Test; import static org.junit.Assert.assertEquals; public class LegalEntityManagementTest extends BaseTest { - @Test public void LegalEntitiesCreateTest() throws Exception { - Client client = createMockClientFromFile("mocks/legalentitymanagement/LegalEntity.json"); - LegalEntities service = new LegalEntities(client); - LegalEntityInfo request = LegalEntityInfo.fromJson("{\n" + - " \"type\": \"individual\",\n" + - " \"individual\": {\n" + - " \"residentialAddress\": {\n" + - " \"city\": \"San Francisco\",\n" + - " \"country\": \"US\",\n" + - " \"postalCode\": \"94107\",\n" + - " \"street\": \"Brannan Street 274\",\n" + - " \"stateOrProvince\": \"CA\"\n" + - " },\n" + - " \"phone\": {\n" + - " \"number\": \"5551231234\",\n" + - " \"type\": \"mobile\"\n" + - " },\n" + - " \"name\": {\n" + - " \"firstName\": \"Simone\",\n" + - " \"lastName\": \"Hopper\"\n" + - " },\n" + - " \"birthData\": {\n" + - " \"dateOfBirth\": \"1981-12-01\"\n" + - " },\n" + - " \"email\": \"s.hopper@example.com\"\n" + - " }\n" + - "}"); - LegalEntity response = service.create(request); + Client client = createMockClientFromFile("mocks/legalentitymanagement/response/LegalEntity.json"); + LegalEntitiesApi service = new LegalEntitiesApi(client); + LegalEntityInfoRequiredType request = LegalEntityInfoRequiredType.fromJson(getFileContents("mocks/legalentitymanagement/request/LegalEntityInfoRequiredType.json")); + LegalEntity response = service.createLegalEntity(request); assertEquals(LegalEntity.TypeEnum.INDIVIDUAL, response.getType()); - assertEquals("LE322JV223222D5GG42KN6869", response.getId()); + assertEquals("string", response.getId()); } @Test public void LegalEntitiesRetrieveTest() throws Exception { - Client client = createMockClientFromFile("mocks/legalentitymanagement/LegalEntity.json"); - LegalEntities service = new LegalEntities(client); - LegalEntity response = service.retrieve("LE322JV223222D5GG42KN6869"); + Client client = createMockClientFromFile("mocks/legalentitymanagement/response/LegalEntity.json"); + LegalEntitiesApi service = new LegalEntitiesApi(client); + LegalEntity response = service.getLegalEntity("LE322JV223222D5GG42KN6869"); assertEquals(LegalEntity.TypeEnum.INDIVIDUAL, response.getType()); - assertEquals("LE322JV223222D5GG42KN6869", response.getId()); + assertEquals("string", response.getId()); } @Test public void LegalEntitiesUpdateTest() throws Exception { - Client client = createMockClientFromFile("mocks/legalentitymanagement/LegalEntity.json"); - LegalEntities service = new LegalEntities(client); + Client client = createMockClientFromFile("mocks/legalentitymanagement/response/LegalEntity.json"); + LegalEntitiesApi service = new LegalEntitiesApi(client); LegalEntityInfo request = LegalEntityInfo.fromJson("{\n" + " \"type\": \"individual\",\n" + " \"individual\": {\n" + @@ -93,127 +71,83 @@ public void LegalEntitiesUpdateTest() throws Exception { " \"email\": \"s.hopper@example.com\"\n" + " }\n" + "}"); - LegalEntity response = service.update("LE322JV223222D5GG42KN6869", request); + LegalEntity response = service.updateLegalEntity("LE322JV223222D5GG42KN6869", request); assertEquals(LegalEntity.TypeEnum.INDIVIDUAL, response.getType()); - assertEquals("LE322JV223222D5GG42KN6869", response.getId()); + assertEquals("string", response.getId()); } @Test public void LegalEntitiesListBusinessLinesTest() throws Exception { - Client client = createMockClientFromFile("mocks/legalentitymanagement/BusinessLines.json"); - LegalEntities service = new LegalEntities(client); - BusinessLines response = service.listBusinessLines("LE322JV223222D5GG42KN6869"); - assertEquals("LE322JV223222D5GG42KN6869", response.getBusinessLines().get(0).getId()); - assertEquals("LE664JV223222D5GG42KN6869", response.getBusinessLines().get(0).getLegalEntityId()); + Client client = createMockClientFromFile("mocks/legalentitymanagement/response/BusinessLines.json"); + LegalEntitiesApi service = new LegalEntitiesApi(client); + BusinessLines response = service.getAllBusinessLinesUnderLegalEntity("LE322JV223222D5GG42KN6869"); + assertEquals("string", response.getBusinessLines().get(0).getId()); + assertEquals("string", response.getBusinessLines().get(0).getLegalEntityId()); } @Test public void TransferInstrumentsCreateTest() throws Exception { - Client client = createMockClientFromFile("mocks/legalentitymanagement/TransferInstrument.json"); - TransferInstruments service = new TransferInstruments(client); - TransferInstrumentInfo request = TransferInstrumentInfo.fromJson("{\n" + - " \"legalEntityId\": \"LE322KH223222D5GG4C9J83RN\",\n" + - " \"type\": \"bankAccount\",\n" + - " \"bankAccount\": {\n" + - " \"countryCode\": \"NL\",\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"iban\": \"NL62ABNA0000000123\"\n" + - " }\n" + - "}"); - TransferInstrument response = service.create(request); + Client client = createMockClientFromFile("mocks/legalentitymanagement/response/TransferInstrument.json"); + TransferInstrumentsApi service = new TransferInstrumentsApi(client); + TransferInstrumentInfo request = TransferInstrumentInfo.fromJson(getFileContents("mocks/legalentitymanagement/request/TransferInstrumentInfo.json")); + TransferInstrument response = service.createTransferInstrument(request); assertEquals(TransferInstrument.TypeEnum.BANKACCOUNT, response.getType()); - assertEquals("SE576BH223222F5GJVKHH6BDT", response.getId()); + assertEquals("string", response.getId()); } @Test public void TransferInstrumentsRetrieveTest() throws Exception { - Client client = createMockClientFromFile("mocks/legalentitymanagement/TransferInstrument.json"); - TransferInstruments service = new TransferInstruments(client); - TransferInstrument response = service.retrieve("SE576BH223222F5GJVKHH6BDT"); + Client client = createMockClientFromFile("mocks/legalentitymanagement/response/TransferInstrument.json"); + TransferInstrumentsApi service = new TransferInstrumentsApi(client); + TransferInstrument response = service.getTransferInstrument("SE576BH223222F5GJVKHH6BDT"); assertEquals(TransferInstrument.TypeEnum.BANKACCOUNT, response.getType()); - assertEquals("SE576BH223222F5GJVKHH6BDT", response.getId()); + assertEquals("string", response.getId()); } @Test public void TransferInstrumentsUpdateTest() throws Exception { - Client client = createMockClientFromFile("mocks/legalentitymanagement/TransferInstrument.json"); - TransferInstruments service = new TransferInstruments(client); - TransferInstrumentInfo request = TransferInstrumentInfo.fromJson("{\n" + - " \"legalEntityId\": \"LE322KH223222D5GG4C9J83RN\",\n" + - " \"type\": \"bankAccount\",\n" + - " \"bankAccount\": {\n" + - " \"countryCode\": \"NL\",\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"iban\": \"NL62ABNA0000000123\"\n" + - " }\n" + - "}"); - TransferInstrument response = service.update("SE576BH223222F5GJVKHH6BDT", request); + Client client = createMockClientFromFile("mocks/legalentitymanagement/response/TransferInstrument.json"); + TransferInstrumentsApi service = new TransferInstrumentsApi(client); + TransferInstrumentInfo request = TransferInstrumentInfo.fromJson(getFileContents("mocks/legalentitymanagement/request/TransferInstrumentInfo.json")); + TransferInstrument response = service.updateTransferInstrument("SE576BH223222F5GJVKHH6BDT", request); assertEquals(TransferInstrument.TypeEnum.BANKACCOUNT, response.getType()); - assertEquals("SE576BH223222F5GJVKHH6BDT", response.getId()); + assertEquals("string", response.getId()); } @Test public void TransferInstrumentsDeleteTest() throws Exception { - Client client = createMockClientFromFile("mocks/legalentitymanagement/TransferInstrument.json"); - TransferInstruments service = new TransferInstruments(client); - service.delete("SE576BH223222F5GJVKHH6BDT"); + Client client = createMockClientFromFile("mocks/legalentitymanagement/response/TransferInstrument.json"); + TransferInstrumentsApi service = new TransferInstrumentsApi(client); + service.deleteTransferInstrument("SE576BH223222F5GJVKHH6BDT"); } @Test public void BusinessLinesCreateTest() throws Exception { - Client client = createMockClientFromFile("mocks/legalentitymanagement/BusinessLine.json"); - BusinessLineService service = new BusinessLineService(client); - BusinessLineInfo request = BusinessLineInfo.fromJson("{\n" + - " \"capability\": \"issueBankAccount\",\n" + - " \"industryCode\": \"55\",\n" + - " \"webData\": [\n" + - " {\n" + - " \"webAddress\": \"https://www.adyen.com\"\n" + - " }\n" + - " ],\n" + - " \"legalEntityId\": \"LE322JV223222D5FZ9N74BSGM\",\n" + - " \"sourceOfFunds\": {\n" + - " \"type\": \"business\",\n" + - " \"adyenProcessedFunds\": \"false\",\n" + - " \"description\": \"Funds from my flower shop business\"\n" + - " }\n" + - "}"); - BusinessLine response = service.create(request); - assertEquals("LE322JV223222D5FZ9N74BSGM", response.getLegalEntityId()); - assertEquals("SE322KT223222D5FJ7TJN2986", response.getId()); + Client client = createMockClientFromFile("mocks/legalentitymanagement/response/BusinessLine.json"); + BusinessLinesApi service = new BusinessLinesApi(client); + BusinessLineInfo request = BusinessLineInfo.fromJson(getFileContents("mocks/legalentitymanagement/request/BusinessLineInfo.json")); + BusinessLine response = service.createBusinessLine(request); + assertEquals("string", response.getLegalEntityId()); + assertEquals("string", response.getId()); } @Test public void BusinessLinesRetrieveTest() throws Exception { - Client client = createMockClientFromFile("mocks/legalentitymanagement/BusinessLine.json"); - BusinessLineService service = new BusinessLineService(client); - BusinessLine response = service.retrieve("SE322KT223222D5FJ7TJN2986"); - assertEquals("LE322JV223222D5FZ9N74BSGM", response.getLegalEntityId()); - assertEquals("SE322KT223222D5FJ7TJN2986", response.getId()); + Client client = createMockClientFromFile("mocks/legalentitymanagement/response/BusinessLine.json"); + BusinessLinesApi service = new BusinessLinesApi(client); + BusinessLine response = service.getBusinessLine("SE322KT223222D5FJ7TJN2986"); + assertEquals("string", response.getLegalEntityId()); + assertEquals("string", response.getId()); } @Test public void BusinessLinesUpdateTest() throws Exception { - Client client = createMockClientFromFile("mocks/legalentitymanagement/BusinessLine.json"); - BusinessLineService service = new BusinessLineService(client); - BusinessLineInfo request = BusinessLineInfo.fromJson("{\n" + - " \"capability\": \"issueBankAccount\",\n" + - " \"industryCode\": \"55\",\n" + - " \"webData\": [\n" + - " {\n" + - " \"webAddress\": \"https://www.adyen.com\"\n" + - " }\n" + - " ],\n" + - " \"legalEntityId\": \"LE322JV223222D5FZ9N74BSGM\",\n" + - " \"sourceOfFunds\": {\n" + - " \"type\": \"business\",\n" + - " \"adyenProcessedFunds\": \"false\",\n" + - " \"description\": \"Funds from my flower shop business\"\n" + - " }\n" + - "}"); - BusinessLine response = service.update("SE322KT223222D5FJ7TJN2986", request); - assertEquals("LE322JV223222D5FZ9N74BSGM", response.getLegalEntityId()); - assertEquals("SE322KT223222D5FJ7TJN2986", response.getId()); + Client client = createMockClientFromFile("mocks/legalentitymanagement/response/BusinessLine.json"); + BusinessLinesApi service = new BusinessLinesApi(client); + BusinessLineInfoUpdate request = BusinessLineInfoUpdate.fromJson(getFileContents("mocks/legalentitymanagement/request/BusinessLineInfoUpdate.json")); + BusinessLine response = service.updateBusinessLine("SE322KT223222D5FJ7TJN2986", request); + assertEquals("string", response.getLegalEntityId()); + assertEquals("string", response.getId()); } @Test @@ -309,29 +243,29 @@ public void DocumentsDeleteTest() throws Exception { @Test public void HostedOnboardingPageCreateTest() throws Exception { Client client = createMockClientFromFile("mocks/legalentitymanagement/OnboardingLink.json"); - HostedOnboarding service = new HostedOnboarding(client); + HostedOnboardingApi service = new HostedOnboardingApi(client); OnboardingLinkInfo request = OnboardingLinkInfo.fromJson("{\n" + " \"locale\": \"cs-CZ\",\n" + " \"redirectUrl\": \"https://your.redirect-url.com\",\n" + " \"themeId\": \"123456789\"\n" + "}"); - OnboardingLink response = service.create("",request); + OnboardingLink response = service.getLinkToAdyenhostedOnboardingPage("",request); assertEquals("https://your.redirect-url.com", response.getUrl()); } @Test public void HostedOnboardingPageListThemesTest() throws Exception { Client client = createMockClientFromFile("mocks/legalentitymanagement/OnboardingThemes.json"); - HostedOnboarding service = new HostedOnboarding(client); - OnboardingThemes response = service.listThemes(); + HostedOnboardingApi service = new HostedOnboardingApi(client); + OnboardingThemes response = service.listHostedOnboardingPageThemes(); assertEquals("SE322KT223222D5FJ7TJN2986", response.getThemes().get(0).getId()); } @Test public void HostedOnboardingPageRetrieveThemesTest() throws Exception { Client client = createMockClientFromFile("mocks/legalentitymanagement/OnboardingTheme.json"); - HostedOnboarding service = new HostedOnboarding(client); - OnboardingTheme response = service.retrieveTheme("SE322KT223222D5FJ7TJN2986"); + HostedOnboardingApi service = new HostedOnboardingApi(client); + OnboardingTheme response = service.getOnboardingLinkTheme("SE322KT223222D5FJ7TJN2986"); assertEquals("SE322KT223222D5FJ7TJN2986", response.getId()); } diff --git a/src/test/resources/mocks/legalentitymanagement/BusinessLine.json b/src/test/resources/mocks/legalentitymanagement/BusinessLine.json deleted file mode 100644 index 1efce18e2..000000000 --- a/src/test/resources/mocks/legalentitymanagement/BusinessLine.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "capability": "issueBankAccount", - "industryCode": "55", - "legalEntityId": "LE322JV223222D5FZ9N74BSGM", - "sourceOfFunds": { - "adyenProcessedFunds": "false", - "description": "Funds from my flower shop business", - "type": "business" - }, - "webData": [ - { - "webAddress": "https://www.adyen.com" - } - ], - "id": "SE322KT223222D5FJ7TJN2986" -} \ No newline at end of file diff --git a/src/test/resources/mocks/legalentitymanagement/BusinessLines.json b/src/test/resources/mocks/legalentitymanagement/BusinessLines.json deleted file mode 100644 index 26bae700f..000000000 --- a/src/test/resources/mocks/legalentitymanagement/BusinessLines.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "businessLines": [{ - "capability": "receivePayments", - "id": "LE322JV223222D5GG42KN6869", - "industryCode": "123456789", - "legalEntityId": "LE664JV223222D5GG42KN6869", - "salesChannels": ["string"], - "sourceOfFunds": { - "acquiringBusinessLineId": "string", - "adyenProcessedFunds": false, - "description": "string", - "type": "business" - }, - "webData": [{ "webAddress": "string" }], - "webDataExemption": { "reason": "noOnlinePresence" } - }] -} \ No newline at end of file diff --git a/src/test/resources/mocks/legalentitymanagement/request/BusinessLineInfo.json b/src/test/resources/mocks/legalentitymanagement/request/BusinessLineInfo.json new file mode 100644 index 000000000..38c43e0e6 --- /dev/null +++ b/src/test/resources/mocks/legalentitymanagement/request/BusinessLineInfo.json @@ -0,0 +1,21 @@ +{ + "industryCode": "string", + "legalEntityId": "string", + "salesChannels": [ + "string" + ], + "service": "paymentProcessing", + "sourceOfFunds": { + "adyenProcessedFunds": true, + "description": "string", + "type": "business" + }, + "webData": [ + { + "webAddress": "string" + } + ], + "webDataExemption": { + "reason": "noOnlinePresence" + } +} \ No newline at end of file diff --git a/src/test/resources/mocks/legalentitymanagement/request/BusinessLineInfoUpdate.json b/src/test/resources/mocks/legalentitymanagement/request/BusinessLineInfoUpdate.json new file mode 100644 index 000000000..38c43e0e6 --- /dev/null +++ b/src/test/resources/mocks/legalentitymanagement/request/BusinessLineInfoUpdate.json @@ -0,0 +1,21 @@ +{ + "industryCode": "string", + "legalEntityId": "string", + "salesChannels": [ + "string" + ], + "service": "paymentProcessing", + "sourceOfFunds": { + "adyenProcessedFunds": true, + "description": "string", + "type": "business" + }, + "webData": [ + { + "webAddress": "string" + } + ], + "webDataExemption": { + "reason": "noOnlinePresence" + } +} \ No newline at end of file diff --git a/src/test/resources/mocks/legalentitymanagement/LegalEntity.json b/src/test/resources/mocks/legalentitymanagement/request/LegalEntityInfoRequiredType.json similarity index 72% rename from src/test/resources/mocks/legalentitymanagement/LegalEntity.json rename to src/test/resources/mocks/legalentitymanagement/request/LegalEntityInfoRequiredType.json index b967eba74..a907c2931 100644 --- a/src/test/resources/mocks/legalentitymanagement/LegalEntity.json +++ b/src/test/resources/mocks/legalentitymanagement/request/LegalEntityInfoRequiredType.json @@ -1,27 +1,20 @@ { - "documentDetails": [{ - "active": false, - "fileName": "string", - "id": "string" - }], - "documents": [{ "id": "string" }], - "entityAssociations": [{ - "associatorId": "string", - "entityType": "string", - "jobTitle": "string", - "legalEntityId": "string", - "name": "string", - "type": "signatory" - }], - "id": "LE322JV223222D5GG42KN6869", + "entityAssociations": [ + { + "jobTitle": "string", + "legalEntityId": "string", + "type": "pciSignatory" + } + ], "individual": { - "birthData": { "dateOfBirth": "string" }, + "birthData": { + "dateOfBirth": "string" + }, "email": "string", "identificationData": { - "expiryDate": "string", - "issuerCountry": "string", + "cardNumber": "string", "issuerState": "string", - "nationalIdExempt": false, + "nationalIdExempt": true, "number": "string", "type": "bankStatement" }, @@ -43,14 +36,19 @@ "street": "string", "street2": "string" }, - "taxInformation": [{ - "country": "string", - "number": "string", - "type": "string" - }], - "webData": { "webAddress": "string" } + "taxInformation": [ + { + "country": "st", + "number": "string", + "type": "string" + } + ], + "webData": { + "webAddress": "string" + } }, "organization": { + "dateOfIncorporation": "string", "description": "string", "doingBusinessAs": "string", "email": "string", @@ -81,11 +79,13 @@ "stockNumber": "string", "tickerSymbol": "string" }, - "taxInformation": [{ - "country": "string", - "number": "string", - "type": "string" - }], + "taxInformation": [ + { + "country": "st", + "number": "string", + "type": "string" + } + ], "taxReportingClassification": { "businessType": "other", "financialInstitutionNumber": "string", @@ -95,11 +95,14 @@ "type": "associationIncorporated", "vatAbsenceReason": "industryExemption", "vatNumber": "string", - "webData": { "webAddress": "string" } + "webData": { + "webAddress": "string" + } }, "reference": "string", "soleProprietorship": { "countryOfGoverningLaw": "string", + "dateOfIncorporation": "string", "doingBusinessAs": "string", "name": "string", "principalPlaceOfBusiness": { @@ -122,6 +125,5 @@ "vatAbsenceReason": "industryExemption", "vatNumber": "string" }, - "transferInstruments": [{ "id": "string", "accountIdentifier": "string" }], "type": "individual" } \ No newline at end of file diff --git a/src/test/resources/mocks/legalentitymanagement/request/TransferInstrumentInfo.json b/src/test/resources/mocks/legalentitymanagement/request/TransferInstrumentInfo.json new file mode 100644 index 000000000..8fb413c8e --- /dev/null +++ b/src/test/resources/mocks/legalentitymanagement/request/TransferInstrumentInfo.json @@ -0,0 +1,12 @@ +{ + "bankAccount": { + "accountIdentification": { + "accountNumber": "string", + "bsbCode": "string", + "type": "auLocal" + }, + "countryCode": "string" + }, + "legalEntityId": "string", + "type": "bankAccount" +} \ No newline at end of file diff --git a/src/test/resources/mocks/legalentitymanagement/response/BusinessLine.json b/src/test/resources/mocks/legalentitymanagement/response/BusinessLine.json new file mode 100644 index 000000000..3765bbbf2 --- /dev/null +++ b/src/test/resources/mocks/legalentitymanagement/response/BusinessLine.json @@ -0,0 +1,73 @@ +{ + "id": "string", + "industryCode": "string", + "legalEntityId": "string", + "problems": [ + { + "entity": { + "documents": [ + "string" + ], + "id": "string", + "owner": { + "documents": [ + "string" + ], + "id": "string", + "type": "BankAccount" + }, + "type": "BankAccount" + }, + "verificationErrors": [ + { + "capabilities": [ + "acceptExternalFunding" + ], + "code": "string", + "message": "string", + "remediatingActions": [ + { + "code": "string", + "message": "string" + } + ], + "subErrors": [ + { + "capabilities": [ + "acceptExternalFunding" + ], + "code": "string", + "message": "string", + "type": "dataMissing", + "remediatingActions": [ + { + "code": "string", + "message": "string" + } + ] + } + ], + "type": "dataMissing" + } + ] + } + ], + "salesChannels": [ + "string" + ], + "service": "paymentProcessing", + "sourceOfFunds": { + "adyenProcessedFunds": true, + "description": "string", + "type": "business" + }, + "webData": [ + { + "webAddress": "string", + "webAddressId": "string" + } + ], + "webDataExemption": { + "reason": "noOnlinePresence" + } +} \ No newline at end of file diff --git a/src/test/resources/mocks/legalentitymanagement/response/BusinessLines.json b/src/test/resources/mocks/legalentitymanagement/response/BusinessLines.json new file mode 100644 index 000000000..bf364eca4 --- /dev/null +++ b/src/test/resources/mocks/legalentitymanagement/response/BusinessLines.json @@ -0,0 +1,77 @@ +{ + "businessLines": [ + { + "id": "string", + "industryCode": "string", + "legalEntityId": "string", + "problems": [ + { + "entity": { + "documents": [ + "string" + ], + "id": "string", + "owner": { + "documents": [ + "string" + ], + "id": "string", + "type": "BankAccount" + }, + "type": "BankAccount" + }, + "verificationErrors": [ + { + "capabilities": [ + "acceptExternalFunding" + ], + "code": "string", + "message": "string", + "remediatingActions": [ + { + "code": "string", + "message": "string" + } + ], + "subErrors": [ + { + "capabilities": [ + "acceptExternalFunding" + ], + "code": "string", + "message": "string", + "type": "dataMissing", + "remediatingActions": [ + { + "code": "string", + "message": "string" + } + ] + } + ], + "type": "dataMissing" + } + ] + } + ], + "salesChannels": [ + "string" + ], + "service": "paymentProcessing", + "sourceOfFunds": { + "adyenProcessedFunds": true, + "description": "string", + "type": "business" + }, + "webData": [ + { + "webAddress": "string", + "webAddressId": "string" + } + ], + "webDataExemption": { + "reason": "noOnlinePresence" + } + } + ] +} \ No newline at end of file diff --git a/src/test/resources/mocks/legalentitymanagement/response/LegalEntity.json b/src/test/resources/mocks/legalentitymanagement/response/LegalEntity.json new file mode 100644 index 000000000..2e3069a57 --- /dev/null +++ b/src/test/resources/mocks/legalentitymanagement/response/LegalEntity.json @@ -0,0 +1,399 @@ +{ + "capabilities": { + "additionalProp1": { + "allowed": true, + "allowedLevel": "high", + "allowedSettings": { + "amountPerIndustry": { + "additionalProp1": { + "currency": "string", + "value": 0 + }, + "additionalProp2": { + "currency": "string", + "value": 0 + }, + "additionalProp3": { + "currency": "string", + "value": 0 + } + }, + "authorizedCardUsers": true, + "fundingSource": [ + "credit" + ], + "interval": "daily", + "maxAmount": { + "currency": "string", + "value": 0 + } + }, + "requested": true, + "requestedLevel": "high", + "requestedSettings": { + "amountPerIndustry": { + "additionalProp1": { + "currency": "string", + "value": 0 + }, + "additionalProp2": { + "currency": "string", + "value": 0 + }, + "additionalProp3": { + "currency": "string", + "value": 0 + } + }, + "authorizedCardUsers": true, + "fundingSource": [ + "credit" + ], + "interval": "daily", + "maxAmount": { + "currency": "string", + "value": 0 + } + }, + "transferInstruments": [ + { + "allowed": true, + "id": "string", + "requested": true, + "verificationStatus": "string" + } + ], + "verificationStatus": "string" + }, + "additionalProp2": { + "allowed": true, + "allowedLevel": "high", + "allowedSettings": { + "amountPerIndustry": { + "additionalProp1": { + "currency": "string", + "value": 0 + }, + "additionalProp2": { + "currency": "string", + "value": 0 + }, + "additionalProp3": { + "currency": "string", + "value": 0 + } + }, + "authorizedCardUsers": true, + "fundingSource": [ + "credit" + ], + "interval": "daily", + "maxAmount": { + "currency": "string", + "value": 0 + } + }, + "requested": true, + "requestedLevel": "high", + "requestedSettings": { + "amountPerIndustry": { + "additionalProp1": { + "currency": "string", + "value": 0 + }, + "additionalProp2": { + "currency": "string", + "value": 0 + }, + "additionalProp3": { + "currency": "string", + "value": 0 + } + }, + "authorizedCardUsers": true, + "fundingSource": [ + "credit" + ], + "interval": "daily", + "maxAmount": { + "currency": "string", + "value": 0 + } + }, + "transferInstruments": [ + { + "allowed": true, + "id": "string", + "requested": true, + "verificationStatus": "string" + } + ], + "verificationStatus": "string" + }, + "additionalProp3": { + "allowed": true, + "allowedLevel": "high", + "allowedSettings": { + "amountPerIndustry": { + "additionalProp1": { + "currency": "string", + "value": 0 + }, + "additionalProp2": { + "currency": "string", + "value": 0 + }, + "additionalProp3": { + "currency": "string", + "value": 0 + } + }, + "authorizedCardUsers": true, + "fundingSource": [ + "credit" + ], + "interval": "daily", + "maxAmount": { + "currency": "string", + "value": 0 + } + }, + "requested": true, + "requestedLevel": "high", + "requestedSettings": { + "amountPerIndustry": { + "additionalProp1": { + "currency": "string", + "value": 0 + }, + "additionalProp2": { + "currency": "string", + "value": 0 + }, + "additionalProp3": { + "currency": "string", + "value": 0 + } + }, + "authorizedCardUsers": true, + "fundingSource": [ + "credit" + ], + "interval": "daily", + "maxAmount": { + "currency": "string", + "value": 0 + } + }, + "transferInstruments": [ + { + "allowed": true, + "id": "string", + "requested": true, + "verificationStatus": "string" + } + ], + "verificationStatus": "string" + } + }, + "documentDetails": [ + { + "active": true, + "description": "string", + "fileName": "string", + "id": "string", + "modificationDate": "2023-04-19T15:28:42.670Z", + "type": "string" + } + ], + "entityAssociations": [ + { + "associatorId": "string", + "entityType": "string", + "jobTitle": "string", + "legalEntityId": "string", + "name": "string", + "type": "pciSignatory" + } + ], + "id": "string", + "individual": { + "birthData": { + "dateOfBirth": "string" + }, + "email": "string", + "identificationData": { + "cardNumber": "string", + "issuerState": "string", + "nationalIdExempt": true, + "number": "string", + "type": "bankStatement" + }, + "name": { + "firstName": "string", + "infix": "string", + "lastName": "string" + }, + "nationality": "string", + "phone": { + "number": "string", + "type": "string" + }, + "residentialAddress": { + "city": "string", + "country": "string", + "postalCode": "string", + "stateOrProvince": "string", + "street": "string", + "street2": "string" + }, + "taxInformation": [ + { + "country": "st", + "number": "string", + "type": "string" + } + ], + "webData": { + "webAddress": "string", + "webAddressId": "string" + } + }, + "organization": { + "dateOfIncorporation": "string", + "description": "string", + "doingBusinessAs": "string", + "email": "string", + "legalName": "string", + "phone": { + "number": "string", + "type": "string" + }, + "principalPlaceOfBusiness": { + "city": "string", + "country": "string", + "postalCode": "string", + "stateOrProvince": "string", + "street": "string", + "street2": "string" + }, + "registeredAddress": { + "city": "string", + "country": "string", + "postalCode": "string", + "stateOrProvince": "string", + "street": "string", + "street2": "string" + }, + "registrationNumber": "string", + "stockData": { + "marketIdentifier": "string", + "stockNumber": "string", + "tickerSymbol": "string" + }, + "taxInformation": [ + { + "country": "st", + "number": "string", + "type": "string" + } + ], + "taxReportingClassification": { + "businessType": "other", + "financialInstitutionNumber": "string", + "mainSourceOfIncome": "businessOperation", + "type": "nonFinancialNonReportable" + }, + "type": "associationIncorporated", + "vatAbsenceReason": "industryExemption", + "vatNumber": "string", + "webData": { + "webAddress": "string", + "webAddressId": "string" + } + }, + "problems": [ + { + "entity": { + "documents": [ + "string" + ], + "id": "string", + "owner": { + "documents": [ + "string" + ], + "id": "string", + "type": "BankAccount" + }, + "type": "BankAccount" + }, + "verificationErrors": [ + { + "capabilities": [ + "acceptExternalFunding" + ], + "code": "string", + "message": "string", + "remediatingActions": [ + { + "code": "string", + "message": "string" + } + ], + "subErrors": [ + { + "capabilities": [ + "acceptExternalFunding" + ], + "code": "string", + "message": "string", + "type": "dataMissing", + "remediatingActions": [ + { + "code": "string", + "message": "string" + } + ] + } + ], + "type": "dataMissing" + } + ] + } + ], + "reference": "string", + "soleProprietorship": { + "countryOfGoverningLaw": "string", + "dateOfIncorporation": "string", + "doingBusinessAs": "string", + "name": "string", + "principalPlaceOfBusiness": { + "city": "string", + "country": "string", + "postalCode": "string", + "stateOrProvince": "string", + "street": "string", + "street2": "string" + }, + "registeredAddress": { + "city": "string", + "country": "string", + "postalCode": "string", + "stateOrProvince": "string", + "street": "string", + "street2": "string" + }, + "registrationNumber": "string", + "vatAbsenceReason": "industryExemption", + "vatNumber": "string" + }, + "transferInstruments": [ + { + "accountIdentifier": "string", + "id": "string", + "realLastFour": "string" + } + ], + "type": "individual" +} \ No newline at end of file diff --git a/src/test/resources/mocks/legalentitymanagement/response/TransferInstrument.json b/src/test/resources/mocks/legalentitymanagement/response/TransferInstrument.json new file mode 100644 index 000000000..a5f8a7cf2 --- /dev/null +++ b/src/test/resources/mocks/legalentitymanagement/response/TransferInstrument.json @@ -0,0 +1,93 @@ +{ + "bankAccount": { + "accountIdentification": { + "accountNumber": "string", + "bsbCode": "string", + "type": "auLocal" + }, + "countryCode": "string" + }, + "capabilities": { + "additionalProp1": { + "allowed": true, + "id": "string", + "requested": true, + "verificationStatus": "string" + }, + "additionalProp2": { + "allowed": true, + "id": "string", + "requested": true, + "verificationStatus": "string" + }, + "additionalProp3": { + "allowed": true, + "id": "string", + "requested": true, + "verificationStatus": "string" + } + }, + "documentDetails": [ + { + "active": true, + "description": "string", + "fileName": "string", + "id": "string", + "modificationDate": "2023-04-20T07:53:09.468Z", + "type": "string" + } + ], + "id": "string", + "legalEntityId": "string", + "problems": [ + { + "entity": { + "documents": [ + "string" + ], + "id": "string", + "owner": { + "documents": [ + "string" + ], + "id": "string", + "type": "BankAccount" + }, + "type": "BankAccount" + }, + "verificationErrors": [ + { + "capabilities": [ + "acceptExternalFunding" + ], + "code": "string", + "message": "string", + "remediatingActions": [ + { + "code": "string", + "message": "string" + } + ], + "subErrors": [ + { + "capabilities": [ + "acceptExternalFunding" + ], + "code": "string", + "message": "string", + "type": "dataMissing", + "remediatingActions": [ + { + "code": "string", + "message": "string" + } + ] + } + ], + "type": "dataMissing" + } + ] + } + ], + "type": "bankAccount" +} \ No newline at end of file diff --git a/templates/libraries/okhttp-gson/pojo.mustache b/templates/libraries/okhttp-gson/pojo.mustache index 79dd40080..102059098 100644 --- a/templates/libraries/okhttp-gson/pojo.mustache +++ b/templates/libraries/okhttp-gson/pojo.mustache @@ -466,7 +466,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens // validate the optional field `{{{baseName}}}` (array) for (int i = 0; i < jsonArray{{name}}.size(); i++) { {{{items.dataType}}}.validateJsonObject(jsonArray{{name}}.get(i).getAsJsonObject()); - }; + } } {{/isRequired}} {{/items.isModel}} From 32286d92c5a16cb7ab30abbdb29a8428ed95f4d0 Mon Sep 17 00:00:00 2001 From: Alexandros Moraitis Date: Wed, 26 Apr 2023 15:38:20 +0200 Subject: [PATCH 17/32] Rename notifications to webhook (#1013) --- ...ketPayNotificationMessageDeserializer.java | 48 +++---- .../AccountCloseNotification.java | 2 +- .../AccountCreateNotification.java | 2 +- ...ccountFundsBelowThresholdNotification.java | 2 +- .../AccountHolderCreateNotification.java | 2 +- .../AccountHolderPayoutNotification.java | 2 +- ...AccountHolderStatusChangeNotification.java | 2 +- ...ntHolderStoreStatusChangeNotification.java | 2 +- ...untHolderUpcomingDeadlineNotification.java | 2 +- .../AccountHolderUpdateNotification.java | 2 +- ...AccountHolderVerificationNotification.java | 2 +- .../AccountUpdateNotification.java | 2 +- .../BeneficiarySetupNotification.java | 2 +- ...CompensateNegativeBalanceNotification.java | 2 +- .../DirectDebitInitiatedNotification.java | 2 +- ...cNotification.java => GenericWebhook.java} | 2 +- .../PaymentFailureNotification.java | 2 +- .../RefundFundsTransferNotification.java | 2 +- .../ReportAvailableNotification.java | 2 +- .../ScheduledRefundsNotification.java | 2 +- .../TransferFundsNotification.java | 2 +- ...cationHandler.java => WebhookHandler.java} | 12 +- .../com/adyen/MarketPayNotificationTest.java | 130 +++++++++--------- ...NotificationTest.java => WebhookTest.java} | 26 ++-- 24 files changed, 123 insertions(+), 133 deletions(-) rename src/main/java/com/adyen/model/marketpay/notification/{GenericNotification.java => GenericWebhook.java} (99%) rename src/main/java/com/adyen/notification/{NotificationHandler.java => WebhookHandler.java} (83%) rename src/test/java/com/adyen/{NotificationTest.java => WebhookTest.java} (92%) diff --git a/src/main/java/com/adyen/deserializer/MarketPayNotificationMessageDeserializer.java b/src/main/java/com/adyen/deserializer/MarketPayNotificationMessageDeserializer.java index a5f58a317..c512325b9 100644 --- a/src/main/java/com/adyen/deserializer/MarketPayNotificationMessageDeserializer.java +++ b/src/main/java/com/adyen/deserializer/MarketPayNotificationMessageDeserializer.java @@ -35,7 +35,7 @@ import com.adyen.model.marketpay.notification.BeneficiarySetupNotification; import com.adyen.model.marketpay.notification.CompensateNegativeBalanceNotification; import com.adyen.model.marketpay.notification.DirectDebitInitiatedNotification; -import com.adyen.model.marketpay.notification.GenericNotification; +import com.adyen.model.marketpay.notification.GenericWebhook; import com.adyen.model.marketpay.notification.PaymentFailureNotification; import com.adyen.model.marketpay.notification.RefundFundsTransferNotification; import com.adyen.model.marketpay.notification.ReportAvailableNotification; @@ -49,74 +49,74 @@ import java.lang.reflect.Type; -public class MarketPayNotificationMessageDeserializer implements JsonDeserializer { +public class MarketPayNotificationMessageDeserializer implements JsonDeserializer { @Override - public GenericNotification deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException { + public GenericWebhook deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException { JsonObject jsonObject = jsonElement.getAsJsonObject(); JsonElement jsonType = jsonObject.get("eventType"); String eventType = jsonType.getAsString(); - if (GenericNotification.EventTypeEnum.ACCOUNT_CREATED.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.ACCOUNT_CREATED.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, AccountCreateNotification.class); } - if (GenericNotification.EventTypeEnum.ACCOUNT_CLOSED.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.ACCOUNT_CLOSED.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, AccountCloseNotification.class); } - if (GenericNotification.EventTypeEnum.ACCOUNT_UPDATED.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.ACCOUNT_UPDATED.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, AccountUpdateNotification.class); } - if (GenericNotification.EventTypeEnum.ACCOUNT_FUNDS_BELOW_THRESHOLD.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.ACCOUNT_FUNDS_BELOW_THRESHOLD.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, AccountFundsBelowThresholdNotification.class); } - if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_CREATED.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.ACCOUNT_HOLDER_CREATED.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, AccountHolderCreateNotification.class); } - if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_VERIFICATION.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.ACCOUNT_HOLDER_VERIFICATION.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, AccountHolderVerificationNotification.class); } - if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_STATUS_CHANGE.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.ACCOUNT_HOLDER_STATUS_CHANGE.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, AccountHolderStatusChangeNotification.class); } - if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_PAYOUT.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.ACCOUNT_HOLDER_PAYOUT.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, AccountHolderPayoutNotification.class); } - if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_UPDATED.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.ACCOUNT_HOLDER_UPDATED.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, AccountHolderUpdateNotification.class); } - if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_STORE_STATUS_CHANGE.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.ACCOUNT_HOLDER_STORE_STATUS_CHANGE.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, AccountHolderStoreStatusChangeNotification.class); } - if (GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_UPCOMING_DEADLINE.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.ACCOUNT_HOLDER_UPCOMING_DEADLINE.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, AccountHolderUpcomingDeadlineNotification.class); } - if (GenericNotification.EventTypeEnum.BENEFICIARY_SETUP.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.BENEFICIARY_SETUP.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, BeneficiarySetupNotification.class); } - if (GenericNotification.EventTypeEnum.SCHEDULED_REFUNDS.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.SCHEDULED_REFUNDS.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, ScheduledRefundsNotification.class); } - if (GenericNotification.EventTypeEnum.COMPENSATE_NEGATIVE_BALANCE.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.COMPENSATE_NEGATIVE_BALANCE.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, CompensateNegativeBalanceNotification.class); } - if (GenericNotification.EventTypeEnum.PAYMENT_FAILURE.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.PAYMENT_FAILURE.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, PaymentFailureNotification.class); } - if (GenericNotification.EventTypeEnum.REPORT_AVAILABLE.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.REPORT_AVAILABLE.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, ReportAvailableNotification.class); } - if (GenericNotification.EventTypeEnum.TRANSFER_FUNDS.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.TRANSFER_FUNDS.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, TransferFundsNotification.class); } - if (GenericNotification.EventTypeEnum.DIRECT_DEBIT_INITIATED.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.DIRECT_DEBIT_INITIATED.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, DirectDebitInitiatedNotification.class); } - if (GenericNotification.EventTypeEnum.PAYOUT_CONFIRMED.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.PAYOUT_CONFIRMED.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, AccountHolderPayoutNotification.class); } - if (GenericNotification.EventTypeEnum.REFUND_FUNDS_TRANSFER.toString().equalsIgnoreCase(eventType)) { + if (GenericWebhook.EventTypeEnum.REFUND_FUNDS_TRANSFER.toString().equalsIgnoreCase(eventType)) { return jsonDeserializationContext.deserialize(jsonElement, RefundFundsTransferNotification.class); } - return jsonDeserializationContext.deserialize(jsonElement, GenericNotification.class); + return jsonDeserializationContext.deserialize(jsonElement, GenericWebhook.class); } } diff --git a/src/main/java/com/adyen/model/marketpay/notification/AccountCloseNotification.java b/src/main/java/com/adyen/model/marketpay/notification/AccountCloseNotification.java index e171709a5..4729f8db1 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/AccountCloseNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/AccountCloseNotification.java @@ -32,7 +32,7 @@ * AccountCloseNotification */ -public class AccountCloseNotification extends GenericNotification { +public class AccountCloseNotification extends GenericWebhook { @SerializedName("content") private CloseAccountResponse content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/AccountCreateNotification.java b/src/main/java/com/adyen/model/marketpay/notification/AccountCreateNotification.java index b8d8d681f..b16db0d8f 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/AccountCreateNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/AccountCreateNotification.java @@ -33,7 +33,7 @@ * AccountCreateNotification */ -public class AccountCreateNotification extends GenericNotification { +public class AccountCreateNotification extends GenericWebhook { @SerializedName("content") private CreateAccountResponse content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/AccountFundsBelowThresholdNotification.java b/src/main/java/com/adyen/model/marketpay/notification/AccountFundsBelowThresholdNotification.java index 477baf5aa..9a239d120 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/AccountFundsBelowThresholdNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/AccountFundsBelowThresholdNotification.java @@ -32,7 +32,7 @@ * AccountFundsBelowThresholdNotification */ -public class AccountFundsBelowThresholdNotification extends GenericNotification { +public class AccountFundsBelowThresholdNotification extends GenericWebhook { @SerializedName("content") private AccountFundsBelowThresholdNotificationContent content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/AccountHolderCreateNotification.java b/src/main/java/com/adyen/model/marketpay/notification/AccountHolderCreateNotification.java index 3d7599b56..c3e6399e6 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/AccountHolderCreateNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/AccountHolderCreateNotification.java @@ -33,7 +33,7 @@ * AccountHolderCreateNotification */ -public class AccountHolderCreateNotification extends GenericNotification { +public class AccountHolderCreateNotification extends GenericWebhook { @SerializedName("content") private CreateAccountHolderResponse content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/AccountHolderPayoutNotification.java b/src/main/java/com/adyen/model/marketpay/notification/AccountHolderPayoutNotification.java index a477c3efe..569c3945a 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/AccountHolderPayoutNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/AccountHolderPayoutNotification.java @@ -33,7 +33,7 @@ * AccountHolderPayoutNotification */ -public class AccountHolderPayoutNotification extends GenericNotification { +public class AccountHolderPayoutNotification extends GenericWebhook { @SerializedName("content") private AccountHolderPayoutNotificationContent content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/AccountHolderStatusChangeNotification.java b/src/main/java/com/adyen/model/marketpay/notification/AccountHolderStatusChangeNotification.java index 9e878c4cd..a0093b6e7 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/AccountHolderStatusChangeNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/AccountHolderStatusChangeNotification.java @@ -28,7 +28,7 @@ import static com.adyen.util.Util.toIndentedString; -public class AccountHolderStatusChangeNotification extends GenericNotification { +public class AccountHolderStatusChangeNotification extends GenericWebhook { @SerializedName("content") private AccountHolderStatusChangeNotificationContent content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/AccountHolderStoreStatusChangeNotification.java b/src/main/java/com/adyen/model/marketpay/notification/AccountHolderStoreStatusChangeNotification.java index 60bed58c8..e82425e9c 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/AccountHolderStoreStatusChangeNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/AccountHolderStoreStatusChangeNotification.java @@ -32,7 +32,7 @@ * AccountHolderStoreStatusChangeNotification */ -public class AccountHolderStoreStatusChangeNotification extends GenericNotification { +public class AccountHolderStoreStatusChangeNotification extends GenericWebhook { @SerializedName("content") private AccountHolderStoreStatusChangeNotificationContent content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/AccountHolderUpcomingDeadlineNotification.java b/src/main/java/com/adyen/model/marketpay/notification/AccountHolderUpcomingDeadlineNotification.java index 70f8e3fae..ae8bf0e71 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/AccountHolderUpcomingDeadlineNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/AccountHolderUpcomingDeadlineNotification.java @@ -32,7 +32,7 @@ * AccountHolderUpcomingDeadlineNotification */ -public class AccountHolderUpcomingDeadlineNotification extends GenericNotification { +public class AccountHolderUpcomingDeadlineNotification extends GenericWebhook { @SerializedName("content") private AccountHolderUpcomingDeadlineNotificationContent content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/AccountHolderUpdateNotification.java b/src/main/java/com/adyen/model/marketpay/notification/AccountHolderUpdateNotification.java index a95f4a92b..ef46b92df 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/AccountHolderUpdateNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/AccountHolderUpdateNotification.java @@ -29,7 +29,7 @@ import static com.adyen.util.Util.toIndentedString; -public class AccountHolderUpdateNotification extends GenericNotification { +public class AccountHolderUpdateNotification extends GenericWebhook { @SerializedName("content") private UpdateAccountHolderResponse content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/AccountHolderVerificationNotification.java b/src/main/java/com/adyen/model/marketpay/notification/AccountHolderVerificationNotification.java index f8d5a2ea8..769d51dbf 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/AccountHolderVerificationNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/AccountHolderVerificationNotification.java @@ -28,7 +28,7 @@ import static com.adyen.util.Util.toIndentedString; -public class AccountHolderVerificationNotification extends GenericNotification { +public class AccountHolderVerificationNotification extends GenericWebhook { @SerializedName("content") private AccountHolderVerificationNotificationContent content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/AccountUpdateNotification.java b/src/main/java/com/adyen/model/marketpay/notification/AccountUpdateNotification.java index c8ea84a84..2be06900b 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/AccountUpdateNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/AccountUpdateNotification.java @@ -32,7 +32,7 @@ * AccountUpdateNotification */ -public class AccountUpdateNotification extends GenericNotification { +public class AccountUpdateNotification extends GenericWebhook { @SerializedName("content") private UpdateAccountResponse content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/BeneficiarySetupNotification.java b/src/main/java/com/adyen/model/marketpay/notification/BeneficiarySetupNotification.java index 55d88efde..f0e73c482 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/BeneficiarySetupNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/BeneficiarySetupNotification.java @@ -28,7 +28,7 @@ import static com.adyen.util.Util.toIndentedString; -public class BeneficiarySetupNotification extends GenericNotification { +public class BeneficiarySetupNotification extends GenericWebhook { @SerializedName("content") private BeneficiarySetupNotificationContent content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/CompensateNegativeBalanceNotification.java b/src/main/java/com/adyen/model/marketpay/notification/CompensateNegativeBalanceNotification.java index db2096c04..df6b00ace 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/CompensateNegativeBalanceNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/CompensateNegativeBalanceNotification.java @@ -28,7 +28,7 @@ import static com.adyen.util.Util.toIndentedString; -public class CompensateNegativeBalanceNotification extends GenericNotification { +public class CompensateNegativeBalanceNotification extends GenericWebhook { @SerializedName("content") private CompensateNegativeBalanceNotificationContent content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/DirectDebitInitiatedNotification.java b/src/main/java/com/adyen/model/marketpay/notification/DirectDebitInitiatedNotification.java index 2f66afbfa..eadd14397 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/DirectDebitInitiatedNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/DirectDebitInitiatedNotification.java @@ -32,7 +32,7 @@ * DirectDebitInitiatedNotification */ -public class DirectDebitInitiatedNotification extends GenericNotification { +public class DirectDebitInitiatedNotification extends GenericWebhook { @SerializedName("content") private DirectDebitInitiatedNotificationContent content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/GenericNotification.java b/src/main/java/com/adyen/model/marketpay/notification/GenericWebhook.java similarity index 99% rename from src/main/java/com/adyen/model/marketpay/notification/GenericNotification.java rename to src/main/java/com/adyen/model/marketpay/notification/GenericWebhook.java index 6c3b47968..d3ad7d7ab 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/GenericNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/GenericWebhook.java @@ -23,7 +23,7 @@ import com.google.gson.annotations.SerializedName; -public class GenericNotification { +public class GenericWebhook { public enum EventTypeEnum { @SerializedName("ACCOUNT_CREATED") ACCOUNT_CREATED("ACCOUNT_CREATED"), diff --git a/src/main/java/com/adyen/model/marketpay/notification/PaymentFailureNotification.java b/src/main/java/com/adyen/model/marketpay/notification/PaymentFailureNotification.java index 2369c6c04..1d42609fc 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/PaymentFailureNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/PaymentFailureNotification.java @@ -28,7 +28,7 @@ import static com.adyen.util.Util.toIndentedString; -public class PaymentFailureNotification extends GenericNotification { +public class PaymentFailureNotification extends GenericWebhook { @SerializedName("content") private PaymentFailureNotificationContent content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/RefundFundsTransferNotification.java b/src/main/java/com/adyen/model/marketpay/notification/RefundFundsTransferNotification.java index 0393da198..65c7a7886 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/RefundFundsTransferNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/RefundFundsTransferNotification.java @@ -32,7 +32,7 @@ * RefundFundsTransferNotification */ -public class RefundFundsTransferNotification extends GenericNotification { +public class RefundFundsTransferNotification extends GenericWebhook { @SerializedName("content") private RefundFundsTransferNotificationContent content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/ReportAvailableNotification.java b/src/main/java/com/adyen/model/marketpay/notification/ReportAvailableNotification.java index 3a957af5b..1e7a688f9 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/ReportAvailableNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/ReportAvailableNotification.java @@ -28,7 +28,7 @@ import static com.adyen.util.Util.toIndentedString; -public class ReportAvailableNotification extends GenericNotification { +public class ReportAvailableNotification extends GenericWebhook { @SerializedName("content") private ReportAvailableNotificationContent content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/ScheduledRefundsNotification.java b/src/main/java/com/adyen/model/marketpay/notification/ScheduledRefundsNotification.java index a06afd037..76de314ee 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/ScheduledRefundsNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/ScheduledRefundsNotification.java @@ -28,7 +28,7 @@ import static com.adyen.util.Util.toIndentedString; -public class ScheduledRefundsNotification extends GenericNotification { +public class ScheduledRefundsNotification extends GenericWebhook { @SerializedName("content") private ScheduledRefundsNotificationContent content = null; diff --git a/src/main/java/com/adyen/model/marketpay/notification/TransferFundsNotification.java b/src/main/java/com/adyen/model/marketpay/notification/TransferFundsNotification.java index 7b66a5e61..8144d46b6 100644 --- a/src/main/java/com/adyen/model/marketpay/notification/TransferFundsNotification.java +++ b/src/main/java/com/adyen/model/marketpay/notification/TransferFundsNotification.java @@ -28,7 +28,7 @@ import static com.adyen.util.Util.toIndentedString; -public class TransferFundsNotification extends GenericNotification { +public class TransferFundsNotification extends GenericWebhook { @SerializedName("content") private TransferFundsNotificationContent content = null; diff --git a/src/main/java/com/adyen/notification/NotificationHandler.java b/src/main/java/com/adyen/notification/WebhookHandler.java similarity index 83% rename from src/main/java/com/adyen/notification/NotificationHandler.java rename to src/main/java/com/adyen/notification/WebhookHandler.java index 0b3494cb2..db8562dfb 100644 --- a/src/main/java/com/adyen/notification/NotificationHandler.java +++ b/src/main/java/com/adyen/notification/WebhookHandler.java @@ -21,7 +21,7 @@ package com.adyen.notification; import com.adyen.deserializer.MarketPayNotificationMessageDeserializer; -import com.adyen.model.marketpay.notification.GenericNotification; +import com.adyen.model.marketpay.notification.GenericWebhook; import com.adyen.model.notification.NotificationRequest; import com.adyen.model.terminal.TerminalAPIRequest; import com.adyen.terminal.serialization.TerminalAPIGsonBuilder; @@ -34,14 +34,14 @@ /** * Notification converter */ -public class NotificationHandler { +public class WebhookHandler { private static final Gson GSON = new Gson(); private final Gson marketPayGson; private final Gson terminalGson; - public NotificationHandler() { + public WebhookHandler() { GsonBuilder gsonBuilder = new GsonBuilder(); - gsonBuilder.registerTypeAdapter(GenericNotification.class, new MarketPayNotificationMessageDeserializer()); + gsonBuilder.registerTypeAdapter(GenericWebhook.class, new MarketPayNotificationMessageDeserializer()); marketPayGson = gsonBuilder.create(); terminalGson = TerminalAPIGsonBuilder.create(); } @@ -50,8 +50,8 @@ public NotificationRequest handleNotificationJson(String json) throws IOExceptio return NotificationRequest.fromJson(json); } - public GenericNotification handleMarketpayNotificationJson(String json) { - return marketPayGson.fromJson(json, GenericNotification.class); + public GenericWebhook handleMarketpayNotificationJson(String json) { + return marketPayGson.fromJson(json, GenericWebhook.class); } // Note that terminal notifications are structured as TerminalAPIRequest objects diff --git a/src/test/java/com/adyen/MarketPayNotificationTest.java b/src/test/java/com/adyen/MarketPayNotificationTest.java index a6d24b2db..db472ac80 100644 --- a/src/test/java/com/adyen/MarketPayNotificationTest.java +++ b/src/test/java/com/adyen/MarketPayNotificationTest.java @@ -44,7 +44,7 @@ import com.adyen.model.marketpay.notification.DeleteNotificationConfigurationRequest; import com.adyen.model.marketpay.notification.DeleteNotificationConfigurationResponse; import com.adyen.model.marketpay.notification.DirectDebitInitiatedNotification; -import com.adyen.model.marketpay.notification.GenericNotification; +import com.adyen.model.marketpay.notification.GenericWebhook; import com.adyen.model.marketpay.notification.GetNotificationConfigurationListResponse; import com.adyen.model.marketpay.notification.GetNotificationConfigurationRequest; import com.adyen.model.marketpay.notification.GetNotificationConfigurationResponse; @@ -59,7 +59,7 @@ import com.adyen.model.marketpay.notification.TransferFundsNotification; import com.adyen.model.marketpay.notification.UpdateNotificationConfigurationRequest; import com.adyen.model.marketpay.notification.UpdateNotificationConfigurationResponse; -import com.adyen.notification.NotificationHandler; +import com.adyen.notification.WebhookHandler; import com.adyen.service.Notification; import org.junit.Assert; import org.junit.Test; @@ -180,11 +180,11 @@ public void TestNotificationConfiguration() throws Exception { @Test public void testMarketPayAccountCreatedNotification() { String json = getFileContents("mocks/marketpay/notification/account-created-success.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.ACCOUNT_CREATED, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.ACCOUNT_CREATED, notificationMessage.getEventType()); AccountCreateNotification accountCreateNotificationMessage = (AccountCreateNotification) notificationMessage; assertEquals("000", accountCreateNotificationMessage.getError().getErrorCode()); @@ -214,11 +214,11 @@ public void testMarketPayAccountCreatedNotification() { @Test public void testMarketPayAccountHolderCreatedNotification() { String json = getFileContents("mocks/marketpay/notification/account-holder-created-success.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_CREATED, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.ACCOUNT_HOLDER_CREATED, notificationMessage.getEventType()); AccountHolderCreateNotification accountHolderCreateNotificationMessage = (AccountHolderCreateNotification) notificationMessage; assertNotNull(accountHolderCreateNotificationMessage.getContent()); assertEquals("AHC00000001", accountHolderCreateNotificationMessage.getContent().getAccountHolderCode()); @@ -229,11 +229,11 @@ public void testMarketPayAccountHolderCreatedNotification() { @Test public void testMarketPayAccountHolderVerificationNotification() { String json = getFileContents("mocks/marketpay/notification/account-holder-verification.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_VERIFICATION, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.ACCOUNT_HOLDER_VERIFICATION, notificationMessage.getEventType()); AccountHolderVerificationNotification notification = (AccountHolderVerificationNotification) notificationMessage; assertNotNull(notification.getContent()); assertEquals("AH0000001", notification.getContent().getAccountHolderCode()); @@ -242,11 +242,11 @@ public void testMarketPayAccountHolderVerificationNotification() { @Test public void testMarketPayAccountHolderStatusChangeNotification() { String json = getFileContents("mocks/marketpay/notification/account-holder-status-change.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_STATUS_CHANGE, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.ACCOUNT_HOLDER_STATUS_CHANGE, notificationMessage.getEventType()); AccountHolderStatusChangeNotification notification = (AccountHolderStatusChangeNotification) notificationMessage; assertNotNull(notification.getContent()); @@ -258,11 +258,11 @@ public void testMarketPayAccountHolderStatusChangeNotification() { @Test public void testMarketPayAccountHolderPayoutFailNotification() { String json = getFileContents("mocks/marketpay/notification/account-holder-payout-fail.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_PAYOUT, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.ACCOUNT_HOLDER_PAYOUT, notificationMessage.getEventType()); AccountHolderPayoutNotification notification = (AccountHolderPayoutNotification) notificationMessage; assertNotNull(notification.getContent()); @@ -275,11 +275,11 @@ public void testMarketPayAccountHolderPayoutFailNotification() { @Test public void testMarketPayAccountHolderPayoutNotification() { String json = getFileContents("mocks/marketpay/notification/account-holder-payout.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_PAYOUT, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.ACCOUNT_HOLDER_PAYOUT, notificationMessage.getEventType()); AccountHolderPayoutNotification notification = (AccountHolderPayoutNotification) notificationMessage; assertNotNull(notification.getContent()); @@ -291,11 +291,11 @@ public void testMarketPayAccountHolderPayoutNotification() { @Test public void testMarketPayAccountHolderUpdatedNotification() { String json = getFileContents("mocks/marketpay/notification/account-holder-updated.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_UPDATED, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.ACCOUNT_HOLDER_UPDATED, notificationMessage.getEventType()); AccountHolderUpdateNotification notification = (AccountHolderUpdateNotification) notificationMessage; assertNotNull(notification.getContent()); @@ -323,11 +323,11 @@ public void testMarketPayAccountHolderUpdatedNotification() { @Test public void testMarketPayBeneficiarySetupNotification() { String json = getFileContents("mocks/marketpay/notification/beneficiary-setup.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.BENEFICIARY_SETUP, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.BENEFICIARY_SETUP, notificationMessage.getEventType()); BeneficiarySetupNotification notification = (BeneficiarySetupNotification) notificationMessage; assertNotNull(notification.getContent()); @@ -338,11 +338,11 @@ public void testMarketPayBeneficiarySetupNotification() { @Test public void testMarketPayScheduledRefundsNotification() { String json = getFileContents("mocks/marketpay/notification/scheduled-refunds-test.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.SCHEDULED_REFUNDS, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.SCHEDULED_REFUNDS, notificationMessage.getEventType()); ScheduledRefundsNotification notification = (ScheduledRefundsNotification) notificationMessage; assertNotNull(notification.getContent()); @@ -354,11 +354,11 @@ public void testMarketPayScheduledRefundsNotification() { @Test public void testMarketPayCompensateNegativeBalanceNotification() { String json = getFileContents("mocks/marketpay/notification/compensate-negative-balance-test.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.COMPENSATE_NEGATIVE_BALANCE, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.COMPENSATE_NEGATIVE_BALANCE, notificationMessage.getEventType()); CompensateNegativeBalanceNotification notification = (CompensateNegativeBalanceNotification) notificationMessage; assertNotNull(notification.getContent()); @@ -369,11 +369,11 @@ public void testMarketPayCompensateNegativeBalanceNotification() { @Test public void testMarketPayPaymentFailureNotification() { String json = getFileContents("mocks/marketpay/notification/payment-failure-test.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.PAYMENT_FAILURE, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.PAYMENT_FAILURE, notificationMessage.getEventType()); PaymentFailureNotification notification = (PaymentFailureNotification) notificationMessage; assertNotNull(notification.getContent()); @@ -384,11 +384,11 @@ public void testMarketPayPaymentFailureNotification() { @Test public void testMarketPayReportAvailableNotification() { String json = getFileContents("mocks/marketpay/notification/report-available-test.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.REPORT_AVAILABLE, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.REPORT_AVAILABLE, notificationMessage.getEventType()); ReportAvailableNotification notification = (ReportAvailableNotification) notificationMessage; assertNotNull(notification.getContent()); @@ -398,11 +398,11 @@ public void testMarketPayReportAvailableNotification() { @Test public void testMarketPayTransferFundsNotification() { String json = getFileContents("mocks/marketpay/notification/transfer-funds-test.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.TRANSFER_FUNDS, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.TRANSFER_FUNDS, notificationMessage.getEventType()); TransferFundsNotification notification = (TransferFundsNotification) notificationMessage; assertNotNull(notification.getContent()); assertEquals(1000L, notification.getContent().getAmount().getValue().longValue()); @@ -419,11 +419,11 @@ public void testMarketPayTransferFundsNotification() { @Test public void testMarketPayAccountClosedNotification() { String json = getFileContents("mocks/marketpay/notification/account-closed-test.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.ACCOUNT_CLOSED, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.ACCOUNT_CLOSED, notificationMessage.getEventType()); AccountCloseNotification notification = (AccountCloseNotification) notificationMessage; assertNotNull(notification.getContent()); assertEquals(1, notification.getContent().getInvalidFields().size()); @@ -432,11 +432,11 @@ public void testMarketPayAccountClosedNotification() { @Test public void testMarketPayAccountUpdatedNotification() { String json = getFileContents("mocks/marketpay/notification/account-updated-test.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.ACCOUNT_UPDATED, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.ACCOUNT_UPDATED, notificationMessage.getEventType()); AccountUpdateNotification notification = (AccountUpdateNotification) notificationMessage; assertNotNull(notification.getContent()); assertEquals(1, notification.getContent().getInvalidFields().size()); @@ -445,11 +445,11 @@ public void testMarketPayAccountUpdatedNotification() { @Test public void testMarketPayAccountFundsBelowThreshold() { String json = getFileContents("mocks/marketpay/notification/account-funds-below-thresold-test.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.ACCOUNT_FUNDS_BELOW_THRESHOLD, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.ACCOUNT_FUNDS_BELOW_THRESHOLD, notificationMessage.getEventType()); AccountFundsBelowThresholdNotification notification = (AccountFundsBelowThresholdNotification) notificationMessage; assertNotNull(notification.getContent()); assertEquals("TestAccountHolder", notification.getContent().getAccountCode()); @@ -460,11 +460,11 @@ public void testMarketPayAccountFundsBelowThreshold() { @Test public void testMarketPayAccountHolderStoreStatusChange() { String json = getFileContents("mocks/marketpay/notification/account-holder-store-status-change-test.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_STORE_STATUS_CHANGE, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.ACCOUNT_HOLDER_STORE_STATUS_CHANGE, notificationMessage.getEventType()); AccountHolderStoreStatusChangeNotification notification = (AccountHolderStoreStatusChangeNotification) notificationMessage; assertNotNull(notification.getContent()); assertEquals("AH000001", notification.getContent().getAccountHolderCode()); @@ -474,11 +474,11 @@ public void testMarketPayAccountHolderStoreStatusChange() { @Test public void testMarketPayAccountHolderUpcomingDeadline() { String json = getFileContents("mocks/marketpay/notification/account-holder-upcoming-deadline-test.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.ACCOUNT_HOLDER_UPCOMING_DEADLINE, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.ACCOUNT_HOLDER_UPCOMING_DEADLINE, notificationMessage.getEventType()); AccountHolderUpcomingDeadlineNotification notification = (AccountHolderUpcomingDeadlineNotification) notificationMessage; assertNotNull(notification.getContent()); assertEquals("testD47", notification.getContent().getAccountHolderCode()); @@ -488,11 +488,11 @@ public void testMarketPayAccountHolderUpcomingDeadline() { @Test public void testMarketPayDirectDebitInitiated() { String json = getFileContents("mocks/marketpay/notification/direct-debit-initiated-test.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.DIRECT_DEBIT_INITIATED, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.DIRECT_DEBIT_INITIATED, notificationMessage.getEventType()); DirectDebitInitiatedNotification notification = (DirectDebitInitiatedNotification) notificationMessage; assertNotNull(notification.getContent()); assertEquals("100000000", notification.getContent().getAccountCode()); @@ -502,11 +502,11 @@ public void testMarketPayDirectDebitInitiated() { @Test public void testMarketPayPayoutConfirmed() { String json = getFileContents("mocks/marketpay/notification/payout-confirmed-test.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.PAYOUT_CONFIRMED, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.PAYOUT_CONFIRMED, notificationMessage.getEventType()); AccountHolderPayoutNotification notification = (AccountHolderPayoutNotification) notificationMessage; assertNotNull(notification.getContent()); assertEquals("100000000", notification.getContent().getAccountCode()); @@ -517,11 +517,11 @@ public void testMarketPayPayoutConfirmed() { @Test public void testMarketPayRefundFundsTransfer() { String json = getFileContents("mocks/marketpay/notification/refund-funds-transfer-test.json"); - NotificationHandler notificationHandler = new NotificationHandler(); + WebhookHandler webhookHandler = new WebhookHandler(); - GenericNotification notificationMessage = notificationHandler.handleMarketpayNotificationJson(json); + GenericWebhook notificationMessage = webhookHandler.handleMarketpayNotificationJson(json); - assertEquals(GenericNotification.EventTypeEnum.REFUND_FUNDS_TRANSFER, notificationMessage.getEventType()); + assertEquals(GenericWebhook.EventTypeEnum.REFUND_FUNDS_TRANSFER, notificationMessage.getEventType()); RefundFundsTransferNotification notification = (RefundFundsTransferNotification) notificationMessage; assertNotNull(notification.getContent()); assertEquals("MRef#000001", notification.getContent().getMerchantReference()); diff --git a/src/test/java/com/adyen/NotificationTest.java b/src/test/java/com/adyen/WebhookTest.java similarity index 92% rename from src/test/java/com/adyen/NotificationTest.java rename to src/test/java/com/adyen/WebhookTest.java index 6defe54be..ee88820be 100644 --- a/src/test/java/com/adyen/NotificationTest.java +++ b/src/test/java/com/adyen/WebhookTest.java @@ -22,30 +22,19 @@ import com.adyen.model.nexo.DeviceType; import com.adyen.model.nexo.DisplayOutput; -import com.adyen.model.nexo.DisplayRequest; -import com.adyen.model.nexo.DisplayResponse; import com.adyen.model.nexo.EventNotification; import com.adyen.model.nexo.EventToNotifyType; import com.adyen.model.nexo.InfoQualifyType; -import com.adyen.model.notification.Amount; import com.adyen.model.notification.NotificationRequest; import com.adyen.model.notification.NotificationRequestItem; -import com.adyen.model.notification.NotificationRequestItemContainer; import com.adyen.model.terminal.TerminalAPIRequest; -import com.adyen.model.terminal.TerminalAPIResponse; -import com.adyen.notification.NotificationHandler; -import com.adyen.service.TerminalCloudAPI; -import com.adyen.terminal.serialization.TerminalAPIGsonBuilder; -import com.google.gson.Gson; +import com.adyen.notification.WebhookHandler; import com.google.gson.JsonParser; -import com.google.gson.reflect.TypeToken; import org.junit.Before; import org.junit.Test; import java.io.IOException; import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -55,13 +44,13 @@ /** * Tests notification messages */ -public class NotificationTest extends BaseTest { +public class WebhookTest extends BaseTest { - private NotificationHandler notificationHandler; + private WebhookHandler webhookHandler; @Before public void init() { - notificationHandler = new NotificationHandler(); + webhookHandler = new WebhookHandler(); } @Test @@ -205,7 +194,8 @@ public void testOfferClosed() throws Exception { @Test public void testTerminalDisplayNotification() throws Exception { String json = getFileContents("mocks/notification/display-notification.json"); - TerminalAPIRequest notification = notificationHandler.handleTerminalNotificationJson(json); + TerminalAPIRequest notification = webhookHandler + .handleTerminalNotificationJson(json); DisplayOutput displayOutput = notification.getSaleToPOIRequest().getDisplayRequest().getDisplayOutput().get(0); assertEquals(InfoQualifyType.STATUS, displayOutput.getInfoQualify()); @@ -216,7 +206,7 @@ public void testTerminalDisplayNotification() throws Exception { @Test public void testTerminalEventNotification() throws Exception { String json = getFileContents("mocks/notification/event-notification.json"); - TerminalAPIRequest notification = notificationHandler.handleTerminalNotificationJson(json); + TerminalAPIRequest notification = webhookHandler.handleTerminalNotificationJson(json); EventNotification eventNotification = notification.getSaleToPOIRequest().getEventNotification(); assertEquals("newstate=IDLE&oldstate=START", eventNotification.getEventDetails()); @@ -244,6 +234,6 @@ private void assertJsonStringEquals(String firstInput, String secondInput) { private NotificationRequest readNotificationRequestFromFile(String resourcePath) throws IOException { String json = getFileContents(resourcePath); - return notificationHandler.handleNotificationJson(json); + return webhookHandler.handleNotificationJson(json); } } From f5f9bb07a63d717193f3b19f41863b1db0c42b5d Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Mon, 1 May 2023 10:49:42 +0200 Subject: [PATCH 18/32] Regen LEM and update tests (#1011) --- .../legalentitymanagement/BusinessLine.java | 4 +- .../BusinessLineInfo.java | 2 +- .../BusinessLineInfoUpdate.java | 2 +- .../legalentitymanagement/BusinessLines.java | 2 +- .../CapabilityProblem.java | 2 +- .../model/legalentitymanagement/Document.java | 2 +- .../GetPciQuestionnaireInfosResponse.java | 2 +- ...TermsOfServiceAcceptanceInfosResponse.java | 2 +- .../legalentitymanagement/Individual.java | 2 +- .../legalentitymanagement/LegalEntity.java | 10 +- .../LegalEntityCapability.java | 2 +- .../LegalEntityInfo.java | 2 +- .../LegalEntityInfoRequiredType.java | 2 +- .../OnboardingThemes.java | 2 +- .../legalentitymanagement/Organization.java | 2 +- .../TransferInstrument.java | 4 +- .../VerificationError.java | 4 +- .../VerificationErrorRecursive.java | 2 +- .../VerificationErrors.java | 2 +- .../BusinessLineService.java | 40 ----- .../BusinessLinesApi.java | 1 + .../legalentitymanagement/Documents.java | 44 ----- .../legalentitymanagement/DocumentsApi.java | 161 ++++++++++++++++++ .../HostedOnboarding.java | 41 ----- .../HostedOnboardingApi.java | 1 + .../legalentitymanagement/LegalEntities.java | 47 ----- .../LegalEntitiesApi.java | 1 + .../PciQuestionnairesApi.java | 1 + .../TermsOfServiceApi.java | 1 + .../TransferInstruments.java | 45 ----- .../TransferInstrumentsApi.java | 1 + .../com/adyen/LegalEntityManagementTest.java | 56 ++++-- 32 files changed, 234 insertions(+), 258 deletions(-) delete mode 100644 src/main/java/com/adyen/service/legalentitymanagement/BusinessLineService.java delete mode 100644 src/main/java/com/adyen/service/legalentitymanagement/Documents.java create mode 100644 src/main/java/com/adyen/service/legalentitymanagement/DocumentsApi.java delete mode 100644 src/main/java/com/adyen/service/legalentitymanagement/HostedOnboarding.java delete mode 100644 src/main/java/com/adyen/service/legalentitymanagement/LegalEntities.java delete mode 100644 src/main/java/com/adyen/service/legalentitymanagement/TransferInstruments.java diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java index 618f5bec0..173541abc 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java @@ -528,7 +528,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `problems` (array) for (int i = 0; i < jsonArrayproblems.size(); i++) { CapabilityProblem.validateJsonObject(jsonArrayproblems.get(i).getAsJsonObject()); - }; + } } // ensure the json data is an array if (jsonObj.get("salesChannels") != null && !jsonObj.get("salesChannels").isJsonArray()) { @@ -555,7 +555,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `webData` (array) for (int i = 0; i < jsonArraywebData.size(); i++) { WebData.validateJsonObject(jsonArraywebData.get(i).getAsJsonObject()); - }; + } } // validate the optional field `webDataExemption` if (jsonObj.getAsJsonObject("webDataExemption") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java index f66dd5110..dd2c611e6 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java @@ -472,7 +472,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `webData` (array) for (int i = 0; i < jsonArraywebData.size(); i++) { WebData.validateJsonObject(jsonArraywebData.get(i).getAsJsonObject()); - }; + } } // validate the optional field `webDataExemption` if (jsonObj.getAsJsonObject("webDataExemption") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java index 7320b32e1..0ae540474 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java @@ -470,7 +470,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `webData` (array) for (int i = 0; i < jsonArraywebData.size(); i++) { WebData.validateJsonObject(jsonArraywebData.get(i).getAsJsonObject()); - }; + } } // validate the optional field `webDataExemption` if (jsonObj.getAsJsonObject("webDataExemption") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java index de859441d..9aaf37107 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java @@ -176,7 +176,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `businessLines` (array) for (int i = 0; i < jsonArraybusinessLines.size(); i++) { BusinessLine.validateJsonObject(jsonArraybusinessLines.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java index 8e0ae8a3c..13bf6b4f0 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java @@ -205,7 +205,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `verificationErrors` (array) for (int i = 0; i < jsonArrayverificationErrors.size(); i++) { VerificationError.validateJsonObject(jsonArrayverificationErrors.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Document.java b/src/main/java/com/adyen/model/legalentitymanagement/Document.java index a6b855a68..804912930 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Document.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Document.java @@ -593,7 +593,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `attachments` (array) for (int i = 0; i < jsonArrayattachments.size(); i++) { Attachment.validateJsonObject(jsonArrayattachments.get(i).getAsJsonObject()); - }; + } } // validate the optional field description if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java index cefb2a4a3..8771369cd 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { PciDocumentInfo.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java index fba64234d..d54826cfe 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { TermsOfServiceAcceptanceInfo.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Individual.java b/src/main/java/com/adyen/model/legalentitymanagement/Individual.java index 517cfb6ff..ca91d914f 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Individual.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Individual.java @@ -446,7 +446,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `taxInformation` (array) for (int i = 0; i < jsonArraytaxInformation.size(); i++) { TaxInformation.validateJsonObject(jsonArraytaxInformation.get(i).getAsJsonObject()); - }; + } } // validate the optional field `webData` if (jsonObj.getAsJsonObject("webData") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java index 9580e0b53..19e220553 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java @@ -572,7 +572,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `documentDetails` (array) for (int i = 0; i < jsonArraydocumentDetails.size(); i++) { DocumentReference.validateJsonObject(jsonArraydocumentDetails.get(i).getAsJsonObject()); - }; + } } JsonArray jsonArraydocuments = jsonObj.getAsJsonArray("documents"); if (jsonArraydocuments != null) { @@ -584,7 +584,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `documents` (array) for (int i = 0; i < jsonArraydocuments.size(); i++) { EntityReference.validateJsonObject(jsonArraydocuments.get(i).getAsJsonObject()); - }; + } } JsonArray jsonArrayentityAssociations = jsonObj.getAsJsonArray("entityAssociations"); if (jsonArrayentityAssociations != null) { @@ -596,7 +596,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `entityAssociations` (array) for (int i = 0; i < jsonArrayentityAssociations.size(); i++) { LegalEntityAssociation.validateJsonObject(jsonArrayentityAssociations.get(i).getAsJsonObject()); - }; + } } // validate the optional field id if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { @@ -620,7 +620,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `problems` (array) for (int i = 0; i < jsonArrayproblems.size(); i++) { CapabilityProblem.validateJsonObject(jsonArrayproblems.get(i).getAsJsonObject()); - }; + } } // validate the optional field reference if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { @@ -640,7 +640,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `transferInstruments` (array) for (int i = 0; i < jsonArraytransferInstruments.size(); i++) { TransferInstrumentReference.validateJsonObject(jsonArraytransferInstruments.get(i).getAsJsonObject()); - }; + } } // ensure the field type can be parsed to an enum value if (jsonObj.get("type") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java index 38c9315c0..9589f8d92 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java @@ -455,7 +455,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `transferInstruments` (array) for (int i = 0; i < jsonArraytransferInstruments.size(); i++) { SupportingEntityCapability.validateJsonObject(jsonArraytransferInstruments.get(i).getAsJsonObject()); - }; + } } // validate the optional field verificationStatus if (jsonObj.get("verificationStatus") != null && !jsonObj.get("verificationStatus").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java index fbeb60ff3..acd1ba720 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java @@ -403,7 +403,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `entityAssociations` (array) for (int i = 0; i < jsonArrayentityAssociations.size(); i++) { LegalEntityAssociation.validateJsonObject(jsonArrayentityAssociations.get(i).getAsJsonObject()); - }; + } } // validate the optional field `individual` if (jsonObj.getAsJsonObject("individual") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java index badada7ec..29f76f7ff 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java @@ -411,7 +411,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `entityAssociations` (array) for (int i = 0; i < jsonArrayentityAssociations.size(); i++) { LegalEntityAssociation.validateJsonObject(jsonArrayentityAssociations.get(i).getAsJsonObject()); - }; + } } // validate the optional field `individual` if (jsonObj.getAsJsonObject("individual") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java index 248dc9cfb..2c2e3366a 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java @@ -242,7 +242,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `themes` (array) for (int i = 0; i < jsonArraythemes.size(); i++) { OnboardingTheme.validateJsonObject(jsonArraythemes.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Organization.java b/src/main/java/com/adyen/model/legalentitymanagement/Organization.java index 5482f7982..210657fc1 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Organization.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Organization.java @@ -762,7 +762,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `taxInformation` (array) for (int i = 0; i < jsonArraytaxInformation.size(); i++) { TaxInformation.validateJsonObject(jsonArraytaxInformation.get(i).getAsJsonObject()); - }; + } } // validate the optional field `taxReportingClassification` if (jsonObj.getAsJsonObject("taxReportingClassification") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java index 54795dca9..619f14984 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java @@ -427,7 +427,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `documentDetails` (array) for (int i = 0; i < jsonArraydocumentDetails.size(); i++) { DocumentReference.validateJsonObject(jsonArraydocumentDetails.get(i).getAsJsonObject()); - }; + } } // validate the optional field id if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { @@ -447,7 +447,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `problems` (array) for (int i = 0; i < jsonArrayproblems.size(); i++) { CapabilityProblem.validateJsonObject(jsonArrayproblems.get(i).getAsJsonObject()); - }; + } } // ensure the field type can be parsed to an enum value if (jsonObj.get("type") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java index 0a7ffb640..3ad3c6c2b 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java @@ -537,7 +537,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `remediatingActions` (array) for (int i = 0; i < jsonArrayremediatingActions.size(); i++) { RemediatingAction.validateJsonObject(jsonArrayremediatingActions.get(i).getAsJsonObject()); - }; + } } JsonArray jsonArraysubErrors = jsonObj.getAsJsonArray("subErrors"); if (jsonArraysubErrors != null) { @@ -549,7 +549,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `subErrors` (array) for (int i = 0; i < jsonArraysubErrors.size(); i++) { VerificationErrorRecursive.validateJsonObject(jsonArraysubErrors.get(i).getAsJsonObject()); - }; + } } // ensure the field type can be parsed to an enum value if (jsonObj.get("type") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java index 124ddb824..796081d21 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java @@ -506,7 +506,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `remediatingActions` (array) for (int i = 0; i < jsonArrayremediatingActions.size(); i++) { RemediatingAction.validateJsonObject(jsonArrayremediatingActions.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java index 2ce149034..7bd8bd094 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `problems` (array) for (int i = 0; i < jsonArrayproblems.size(); i++) { CapabilityProblem.validateJsonObject(jsonArrayproblems.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/service/legalentitymanagement/BusinessLineService.java b/src/main/java/com/adyen/service/legalentitymanagement/BusinessLineService.java deleted file mode 100644 index 6dd2d8eb0..000000000 --- a/src/main/java/com/adyen/service/legalentitymanagement/BusinessLineService.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.adyen.service.legalentitymanagement; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.constants.ApiConstants; -import com.adyen.model.legalentitymanagement.BusinessLine; -import com.adyen.model.legalentitymanagement.BusinessLineInfo; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.LegalEntityManagementResource; - -import java.io.IOException; - -/** - * @deprecated replaced by {@link BusinessLinesApi} - */ -public class BusinessLineService extends Service { - public BusinessLineService(Client client) { - super(client); - } - - public BusinessLine create(BusinessLineInfo request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, "/businessLines"); - String jsonResult = resource.request(jsonRequest); - return BusinessLine.fromJson(jsonResult); - } - - public BusinessLine retrieve(String businessLineId) throws IOException, ApiException { - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, String.format("/businessLines/%s", businessLineId)); - String jsonResult = resource.request(null, ApiConstants.HttpMethod.GET); - return BusinessLine.fromJson(jsonResult); - } - - public BusinessLine update(String businessLineId, BusinessLineInfo request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, String.format("/businessLines/%s", businessLineId)); - String jsonResult = resource.request(jsonRequest, ApiConstants.HttpMethod.PATCH); - return BusinessLine.fromJson(jsonResult); - } -} diff --git a/src/main/java/com/adyen/service/legalentitymanagement/BusinessLinesApi.java b/src/main/java/com/adyen/service/legalentitymanagement/BusinessLinesApi.java index 4a0038957..1e2e31399 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/BusinessLinesApi.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/BusinessLinesApi.java @@ -17,6 +17,7 @@ import com.adyen.model.legalentitymanagement.BusinessLine; import com.adyen.model.legalentitymanagement.BusinessLineInfo; import com.adyen.model.legalentitymanagement.BusinessLineInfoUpdate; +import com.adyen.model.legalentitymanagement.ServiceError; import com.adyen.model.RequestOptions; import com.adyen.service.exception.ApiException; import com.adyen.service.resource.Resource; diff --git a/src/main/java/com/adyen/service/legalentitymanagement/Documents.java b/src/main/java/com/adyen/service/legalentitymanagement/Documents.java deleted file mode 100644 index 035ab6324..000000000 --- a/src/main/java/com/adyen/service/legalentitymanagement/Documents.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.adyen.service.legalentitymanagement; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.constants.ApiConstants; -import com.adyen.model.legalentitymanagement.Document; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.LegalEntityManagementResource; - -import java.io.IOException; - -/** - * @deprecated replaced by {@link DocumentsApi} - */ -public class Documents extends Service { - public Documents(Client client) { - super(client); - } - - public Document create(Document request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, "/documents"); - String jsonResult = resource.request(jsonRequest); - return Document.fromJson(jsonResult); - } - - public Document retrieve(String documentId) throws IOException, ApiException { - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, String.format("/documents/%s", documentId)); - String jsonResult = resource.request(null, ApiConstants.HttpMethod.GET); - return Document.fromJson(jsonResult); - } - - public Document update(String documentId, Document request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, String.format("/documents/%s", documentId)); - String jsonResult = resource.request(jsonRequest, ApiConstants.HttpMethod.PATCH); - return Document.fromJson(jsonResult); - } - - public void delete(String documentId) throws IOException, ApiException { - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, String.format("/documents/%s", documentId)); - resource.request(null, ApiConstants.HttpMethod.DELETE); - } -} diff --git a/src/main/java/com/adyen/service/legalentitymanagement/DocumentsApi.java b/src/main/java/com/adyen/service/legalentitymanagement/DocumentsApi.java new file mode 100644 index 000000000..d1ff6e628 --- /dev/null +++ b/src/main/java/com/adyen/service/legalentitymanagement/DocumentsApi.java @@ -0,0 +1,161 @@ +/* + * Legal Entity Management API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.legalentitymanagement; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.legalentitymanagement.Document; +import com.adyen.model.legalentitymanagement.ServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class DocumentsApi extends Service { + private final String baseURL; + + public DocumentsApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://kyc-test.adyen.com/lem/v3"); + } + + /** + * Delete a document + * + * @param id {@link String } The unique identifier of the document to be deleted. (required) + * @return {@link Object } + * @throws ApiException if fails to make API call + */ + public void deleteDocument(String id) throws ApiException, IOException { + deleteDocument(id, null); + } + + /** + * Delete a document + * + * @param id {@link String } The unique identifier of the document to be deleted. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Object } + * @throws ApiException if fails to make API call + */ + public void deleteDocument(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/documents/{id}", null); + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.DELETE, pathParams); + } + + /** + * Get a document + * + * @param id {@link String } The unique identifier of the document. (required) + * @return {@link Document } + * @throws ApiException if fails to make API call + */ + public Document getDocument(String id) throws ApiException, IOException { + return getDocument(id, null); + } + + /** + * Get a document + * + * @param id {@link String } The unique identifier of the document. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Document } + * @throws ApiException if fails to make API call + */ + public Document getDocument(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/documents/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return Document.fromJson(jsonResult); + } + + /** + * Update a document + * + * @param id {@link String } The unique identifier of the document to be updated. (required) + * @param document {@link Document } (required) + * @return {@link Document } + * @throws ApiException if fails to make API call + */ + public Document updateDocument(String id, Document document) throws ApiException, IOException { + return updateDocument(id, document, null); + } + + /** + * Update a document + * + * @param id {@link String } The unique identifier of the document to be updated. (required) + * @param document {@link Document } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Document } + * @throws ApiException if fails to make API call + */ + public Document updateDocument(String id, Document document, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = document.toJson(); + Resource resource = new Resource(this, this.baseURL + "/documents/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return Document.fromJson(jsonResult); + } + + /** + * Upload a document for verification checks + * + * @param document {@link Document } (required) + * @return {@link Document } + * @throws ApiException if fails to make API call + */ + public Document uploadDocumentForVerificationChecks(Document document) throws ApiException, IOException { + return uploadDocumentForVerificationChecks(document, null); + } + + /** + * Upload a document for verification checks + * + * @param document {@link Document } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Document } + * @throws ApiException if fails to make API call + */ + public Document uploadDocumentForVerificationChecks(Document document, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = document.toJson(); + Resource resource = new Resource(this, this.baseURL + "/documents", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return Document.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboarding.java b/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboarding.java deleted file mode 100644 index a8d8223d3..000000000 --- a/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboarding.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.adyen.service.legalentitymanagement; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.constants.ApiConstants; -import com.adyen.model.legalentitymanagement.OnboardingLink; -import com.adyen.model.legalentitymanagement.OnboardingLinkInfo; -import com.adyen.model.legalentitymanagement.OnboardingTheme; -import com.adyen.model.legalentitymanagement.OnboardingThemes; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.LegalEntityManagementResource; - -import java.io.IOException; - -/** - * @deprecated replaced by {@link HostedOnboardingApi} - */ -public class HostedOnboarding extends Service { - public HostedOnboarding(Client client) { - super(client); - } - - public OnboardingLink create(String legalEntityId, OnboardingLinkInfo request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, String.format("/legalEntities/%s/onboardingLinks", legalEntityId)); - String jsonResult = resource.request(jsonRequest); - return OnboardingLink.fromJson(jsonResult); - } - - public OnboardingThemes listThemes() throws IOException, ApiException { - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, "/themes"); - String jsonResult = resource.request(null, ApiConstants.HttpMethod.GET); - return OnboardingThemes.fromJson(jsonResult); - } - - public OnboardingTheme retrieveTheme(String themeId) throws IOException, ApiException { - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, String.format("/themes/%s", themeId)); - String jsonResult = resource.request(null, ApiConstants.HttpMethod.GET); - return OnboardingTheme.fromJson(jsonResult); - } -} diff --git a/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboardingApi.java b/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboardingApi.java index dbcd163fc..0199a6426 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboardingApi.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/HostedOnboardingApi.java @@ -18,6 +18,7 @@ import com.adyen.model.legalentitymanagement.OnboardingLinkInfo; import com.adyen.model.legalentitymanagement.OnboardingTheme; import com.adyen.model.legalentitymanagement.OnboardingThemes; +import com.adyen.model.legalentitymanagement.ServiceError; import com.adyen.model.RequestOptions; import com.adyen.service.exception.ApiException; import com.adyen.service.resource.Resource; diff --git a/src/main/java/com/adyen/service/legalentitymanagement/LegalEntities.java b/src/main/java/com/adyen/service/legalentitymanagement/LegalEntities.java deleted file mode 100644 index 4c2d53d2a..000000000 --- a/src/main/java/com/adyen/service/legalentitymanagement/LegalEntities.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.adyen.service.legalentitymanagement; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.constants.ApiConstants; -import com.adyen.model.legalentitymanagement.BusinessLines; -import com.adyen.model.legalentitymanagement.LegalEntity; -import com.adyen.model.legalentitymanagement.LegalEntityInfo; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.LegalEntityManagementResource; - -import java.io.IOException; - -/** - * @deprecated replaced by {@link LegalEntitiesApi} - */ -public class LegalEntities extends Service { - public LegalEntities(Client client) { - super(client); - } - - public LegalEntity create(LegalEntityInfo request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, "/legalEntities"); - String jsonResult = resource.request(jsonRequest); - return LegalEntity.fromJson(jsonResult); - } - - public LegalEntity retrieve(String legalEntityId) throws IOException, ApiException { - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, String.format("/legalEntities/%s", legalEntityId)); - String jsonResult = resource.request(null, ApiConstants.HttpMethod.GET); - return LegalEntity.fromJson(jsonResult); - } - - public LegalEntity update(String legalEntityId, LegalEntityInfo request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, String.format("/legalEntities/%s", legalEntityId)); - String jsonResult = resource.request(jsonRequest, ApiConstants.HttpMethod.PATCH); - return LegalEntity.fromJson(jsonResult); - } - - public BusinessLines listBusinessLines(String legalEntityId) throws IOException, ApiException { - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, String.format("/legalEntities/%s/businessLines", legalEntityId)); - String jsonResult = resource.request(null, ApiConstants.HttpMethod.GET); - return BusinessLines.fromJson(jsonResult); - } -} diff --git a/src/main/java/com/adyen/service/legalentitymanagement/LegalEntitiesApi.java b/src/main/java/com/adyen/service/legalentitymanagement/LegalEntitiesApi.java index f6721c12d..38c98fdf9 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/LegalEntitiesApi.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/LegalEntitiesApi.java @@ -18,6 +18,7 @@ import com.adyen.model.legalentitymanagement.LegalEntity; import com.adyen.model.legalentitymanagement.LegalEntityInfo; import com.adyen.model.legalentitymanagement.LegalEntityInfoRequiredType; +import com.adyen.model.legalentitymanagement.ServiceError; import com.adyen.model.legalentitymanagement.VerificationErrors; import com.adyen.model.RequestOptions; import com.adyen.service.exception.ApiException; diff --git a/src/main/java/com/adyen/service/legalentitymanagement/PciQuestionnairesApi.java b/src/main/java/com/adyen/service/legalentitymanagement/PciQuestionnairesApi.java index 93e2928b8..066b9789d 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/PciQuestionnairesApi.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/PciQuestionnairesApi.java @@ -20,6 +20,7 @@ import com.adyen.model.legalentitymanagement.GetPciQuestionnaireResponse; import com.adyen.model.legalentitymanagement.PciSigningRequest; import com.adyen.model.legalentitymanagement.PciSigningResponse; +import com.adyen.model.legalentitymanagement.ServiceError; import com.adyen.model.RequestOptions; import com.adyen.service.exception.ApiException; import com.adyen.service.resource.Resource; diff --git a/src/main/java/com/adyen/service/legalentitymanagement/TermsOfServiceApi.java b/src/main/java/com/adyen/service/legalentitymanagement/TermsOfServiceApi.java index dd43a18f8..39ded0771 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/TermsOfServiceApi.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/TermsOfServiceApi.java @@ -19,6 +19,7 @@ import com.adyen.model.legalentitymanagement.GetTermsOfServiceAcceptanceInfosResponse; import com.adyen.model.legalentitymanagement.GetTermsOfServiceDocumentRequest; import com.adyen.model.legalentitymanagement.GetTermsOfServiceDocumentResponse; +import com.adyen.model.legalentitymanagement.ServiceError; import com.adyen.model.RequestOptions; import com.adyen.service.exception.ApiException; import com.adyen.service.resource.Resource; diff --git a/src/main/java/com/adyen/service/legalentitymanagement/TransferInstruments.java b/src/main/java/com/adyen/service/legalentitymanagement/TransferInstruments.java deleted file mode 100644 index f73b38199..000000000 --- a/src/main/java/com/adyen/service/legalentitymanagement/TransferInstruments.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.adyen.service.legalentitymanagement; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.constants.ApiConstants; -import com.adyen.model.legalentitymanagement.TransferInstrument; -import com.adyen.model.legalentitymanagement.TransferInstrumentInfo; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.LegalEntityManagementResource; - -import java.io.IOException; - -/** - * @deprecated replaced by {@link TransferInstrumentsApi} - */ -public class TransferInstruments extends Service { - public TransferInstruments(Client client) { - super(client); - } - - public TransferInstrument create(TransferInstrumentInfo request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, "/transferInstruments"); - String jsonResult = resource.request(jsonRequest); - return TransferInstrument.fromJson(jsonResult); - } - - public TransferInstrument retrieve(String transferInstrumentId) throws IOException, ApiException { - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, String.format("/transferInstruments/%s", transferInstrumentId)); - String jsonResult = resource.request(null, ApiConstants.HttpMethod.GET); - return TransferInstrument.fromJson(jsonResult); - } - - public TransferInstrument update(String transferInstrumentId, TransferInstrumentInfo request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, String.format("/transferInstruments/%s", transferInstrumentId)); - String jsonResult = resource.request(jsonRequest, ApiConstants.HttpMethod.PATCH); - return TransferInstrument.fromJson(jsonResult); - } - - public void delete(String transferInstrumentId) throws IOException, ApiException { - LegalEntityManagementResource resource = new LegalEntityManagementResource(this, String.format("/transferInstruments/%s", transferInstrumentId)); - resource.request(null, ApiConstants.HttpMethod.DELETE); - } -} diff --git a/src/main/java/com/adyen/service/legalentitymanagement/TransferInstrumentsApi.java b/src/main/java/com/adyen/service/legalentitymanagement/TransferInstrumentsApi.java index b28f21722..6299ce512 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/TransferInstrumentsApi.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/TransferInstrumentsApi.java @@ -14,6 +14,7 @@ import com.adyen.Client; import com.adyen.Service; import com.adyen.constants.ApiConstants; +import com.adyen.model.legalentitymanagement.ServiceError; import com.adyen.model.legalentitymanagement.TransferInstrument; import com.adyen.model.legalentitymanagement.TransferInstrumentInfo; import com.adyen.model.RequestOptions; diff --git a/src/test/java/com/adyen/LegalEntityManagementTest.java b/src/test/java/com/adyen/LegalEntityManagementTest.java index aa56c645b..fea7493fd 100644 --- a/src/test/java/com/adyen/LegalEntityManagementTest.java +++ b/src/test/java/com/adyen/LegalEntityManagementTest.java @@ -1,5 +1,6 @@ package com.adyen; +import com.adyen.constants.ApiConstants; import com.adyen.model.legalentitymanagement.BusinessLine; import com.adyen.model.legalentitymanagement.BusinessLineInfo; import com.adyen.model.legalentitymanagement.BusinessLineInfoUpdate; @@ -14,14 +15,12 @@ import com.adyen.model.legalentitymanagement.OnboardingThemes; import com.adyen.model.legalentitymanagement.TransferInstrument; import com.adyen.model.legalentitymanagement.TransferInstrumentInfo; -import com.adyen.service.legalentitymanagement.BusinessLinesApi; -import com.adyen.service.legalentitymanagement.Documents; -import com.adyen.service.legalentitymanagement.HostedOnboardingApi; -import com.adyen.service.legalentitymanagement.LegalEntitiesApi; -import com.adyen.service.legalentitymanagement.TransferInstrumentsApi; +import com.adyen.service.legalentitymanagement.*; import org.junit.Test; import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.verify; public class LegalEntityManagementTest extends BaseTest { @Test @@ -148,12 +147,21 @@ public void BusinessLinesUpdateTest() throws Exception { BusinessLine response = service.updateBusinessLine("SE322KT223222D5FJ7TJN2986", request); assertEquals("string", response.getLegalEntityId()); assertEquals("string", response.getId()); + verify(client.getHttpClient()).request( + "https://kyc-test.adyen.com/lem/v3/businessLines/SE322KT223222D5FJ7TJN2986", + request.toJson(), + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.PATCH, + null + ); } @Test public void DocumentsCreateTest() throws Exception { Client client = createMockClientFromFile("mocks/legalentitymanagement/Document.json"); - Documents service = new Documents(client); + DocumentsApi service = new DocumentsApi(client); Document request = Document.fromJson("{\n" + " \"attachment\": {\n" + " \"content\": \"string\",\n" + @@ -182,7 +190,7 @@ public void DocumentsCreateTest() throws Exception { " },\n" + " \"type\": \"bankStatement\"\n" + "}"); - Document response = service.create(request); + Document response = service.uploadDocumentForVerificationChecks(request); assertEquals(Document.TypeEnum.DRIVERSLICENSE, response.getType()); assertEquals("SE322KT223222D5FJ7TJN2986", response.getId()); } @@ -190,8 +198,8 @@ public void DocumentsCreateTest() throws Exception { @Test public void DocumentsRetrieveTest() throws Exception { Client client = createMockClientFromFile("mocks/legalentitymanagement/Document.json"); - Documents service = new Documents(client); - Document response = service.retrieve("SE322KT223222D5FJ7TJN2986"); + DocumentsApi service = new DocumentsApi(client); + Document response = service.getDocument("SE322KT223222D5FJ7TJN2986"); assertEquals(Document.TypeEnum.DRIVERSLICENSE, response.getType()); assertEquals("SE322KT223222D5FJ7TJN2986", response.getId()); } @@ -199,7 +207,7 @@ public void DocumentsRetrieveTest() throws Exception { @Test public void DocumentsUpdateTest() throws Exception { Client client = createMockClientFromFile("mocks/legalentitymanagement/Document.json"); - Documents service = new Documents(client); + DocumentsApi service = new DocumentsApi(client); Document request = Document.fromJson("{\n" + " \"attachment\": {\n" + " \"content\": \"string\",\n" + @@ -228,7 +236,7 @@ public void DocumentsUpdateTest() throws Exception { " },\n" + " \"type\": \"bankStatement\"\n" + "}"); - Document response = service.update("SE322KT223222D5FJ7TJN2986", request); + Document response = service.updateDocument("SE322KT223222D5FJ7TJN2986", request); assertEquals(Document.TypeEnum.DRIVERSLICENSE, response.getType()); assertEquals("SE322KT223222D5FJ7TJN2986", response.getId()); } @@ -236,8 +244,17 @@ public void DocumentsUpdateTest() throws Exception { @Test public void DocumentsDeleteTest() throws Exception { Client client = createMockClientFromFile("mocks/legalentitymanagement/Document.json"); - Documents service = new Documents(client); - service.delete("SE322KT223222D5FJ7TJN2986"); + DocumentsApi service = new DocumentsApi(client); + service.deleteDocument("SE322KT223222D5FJ7TJN2986"); + verify(client.getHttpClient()).request( + "https://kyc-test.adyen.com/lem/v3/documents/SE322KT223222D5FJ7TJN2986", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.DELETE, + null + ); } @Test @@ -267,12 +284,21 @@ public void HostedOnboardingPageRetrieveThemesTest() throws Exception { HostedOnboardingApi service = new HostedOnboardingApi(client); OnboardingTheme response = service.getOnboardingLinkTheme("SE322KT223222D5FJ7TJN2986"); assertEquals("SE322KT223222D5FJ7TJN2986", response.getId()); + verify(client.getHttpClient()).request( + "https://kyc-test.adyen.com/lem/v3/themes/SE322KT223222D5FJ7TJN2986", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + null + ); } @Test public void TestBase64EncodedResponseToByteArray() throws Exception { Client client = createMockClientFromFile("mocks/legalentitymanagement/Document.json"); - Documents service = new Documents(client); + DocumentsApi service = new DocumentsApi(client); Document request = Document.fromJson("{\n" + " \"attachment\": {\n" + " \"content\": \"string\",\n" + @@ -301,7 +327,7 @@ public void TestBase64EncodedResponseToByteArray() throws Exception { " },\n" + " \"type\": \"bankStatement\"\n" + "}"); - Document response = service.update("SE322KT223222D5FJ7TJN2986", request); + Document response = service.updateDocument("SE322KT223222D5FJ7TJN2986", request); assertEquals("Thisisanbase64encodedstring", new String(response.getAttachments().get(0).getContent())); } } From 7b8a3eedab9540b1cddc2fccf9f86b85b1b5504e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 11:24:08 +0200 Subject: [PATCH 19/32] chore(deps): update dependency org.apache.maven.plugins:maven-checkstyle-plugin to v3.2.2 (#1004) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 50136fb64..9aecc2afb 100644 --- a/pom.xml +++ b/pom.xml @@ -142,7 +142,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.2.1 + 3.2.2 checkstyle.xml checkstyle-suppressions.xml From 3a91f8dddab66f866d25e60345d6aa3246a5fbfc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 11:24:22 +0200 Subject: [PATCH 20/32] chore(deps): update dependency org.jacoco:jacoco-maven-plugin to v0.8.10 (#1012) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9aecc2afb..5844a447b 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ org.jacoco jacoco-maven-plugin - 0.8.9 + 0.8.10 default-prepare-agent From f1dd2328c4af2046f5552e093b1332764e186e71 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Mon, 1 May 2023 12:42:55 +0200 Subject: [PATCH 21/32] generate storedvalue/payout/transfers (#1006) --- .../java/com/adyen/model/payout/Card.java | 19 +- .../model/payout/FraudCheckResultWrapper.java | 209 +++++ .../com/adyen/model/payout/FraudResult.java | 14 +- .../java/com/adyen/model/payout/JSON.java | 1 + .../payout/StoreDetailAndSubmitRequest.java | 10 +- .../model/payout/StoreDetailRequest.java | 10 +- .../com/adyen/model/payout/SubmitRequest.java | 10 +- .../storedvalue/AbstractOpenApiSchema.java | 145 ++++ .../com/adyen/model/storedvalue/Amount.java | 302 +++++-- .../com/adyen/model/storedvalue/JSON.java | 413 +++++++++ .../adyen/model/storedvalue/ServiceError.java | 377 ++++++++ .../StoredValueBalanceCheckRequest.java | 683 +++++++++------ .../StoredValueBalanceCheckResponse.java | 524 ++++++++---- .../StoredValueBalanceMergeRequest.java | 732 ++++++++++------ .../StoredValueBalanceMergeResponse.java | 572 ++++++++----- .../storedvalue/StoredValueIssueRequest.java | 684 +++++++++------ .../storedvalue/StoredValueIssueResponse.java | 629 +++++++++----- .../storedvalue/StoredValueLoadRequest.java | 808 +++++++++++------- .../storedvalue/StoredValueLoadResponse.java | 572 ++++++++----- .../StoredValueStatusChangeRequest.java | 808 +++++++++++------- .../StoredValueStatusChangeResponse.java | 572 ++++++++----- .../storedvalue/StoredValueVoidRequest.java | 497 +++++++---- .../storedvalue/StoredValueVoidResponse.java | 524 ++++++++---- src/main/java/com/adyen/service/Payout.java | 182 ---- .../java/com/adyen/service/StoredValue.java | 135 --- .../com/adyen/service/StoredValueApi.java | 208 +++++ .../service/payout/InitializationApi.java | 120 +++ .../service/payout/InstantPayoutsApi.java | 62 ++ .../adyen/service/payout/ReviewingApi.java | 89 ++ .../service/transfers/TransactionsApi.java | 130 +++ .../adyen/service/transfers/TransfersApi.java | 62 ++ src/test/java/com/adyen/PayoutTest.java | 22 +- 32 files changed, 6966 insertions(+), 3159 deletions(-) create mode 100644 src/main/java/com/adyen/model/payout/FraudCheckResultWrapper.java create mode 100644 src/main/java/com/adyen/model/storedvalue/AbstractOpenApiSchema.java create mode 100644 src/main/java/com/adyen/model/storedvalue/JSON.java create mode 100644 src/main/java/com/adyen/model/storedvalue/ServiceError.java mode change 100755 => 100644 src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java mode change 100755 => 100644 src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java mode change 100755 => 100644 src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java mode change 100755 => 100644 src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java mode change 100755 => 100644 src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java mode change 100755 => 100644 src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java mode change 100755 => 100644 src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java mode change 100755 => 100644 src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java mode change 100755 => 100644 src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java mode change 100755 => 100644 src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java mode change 100755 => 100644 src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java mode change 100755 => 100644 src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java delete mode 100644 src/main/java/com/adyen/service/Payout.java delete mode 100644 src/main/java/com/adyen/service/StoredValue.java create mode 100644 src/main/java/com/adyen/service/StoredValueApi.java create mode 100644 src/main/java/com/adyen/service/payout/InitializationApi.java create mode 100644 src/main/java/com/adyen/service/payout/InstantPayoutsApi.java create mode 100644 src/main/java/com/adyen/service/payout/ReviewingApi.java create mode 100644 src/main/java/com/adyen/service/transfers/TransactionsApi.java create mode 100644 src/main/java/com/adyen/service/transfers/TransfersApi.java diff --git a/src/main/java/com/adyen/model/payout/Card.java b/src/main/java/com/adyen/model/payout/Card.java index 17845f6de..d17b9a74d 100644 --- a/src/main/java/com/adyen/model/payout/Card.java +++ b/src/main/java/com/adyen/model/payout/Card.java @@ -115,7 +115,7 @@ public Card expiryMonth(String expiryMonth) { * The card expiry month. Format: 2 digits, zero-padded for single digits. For example: * 03 = March * 11 = November * @return expiryMonth **/ - @ApiModelProperty(required = true, value = "The card expiry month. Format: 2 digits, zero-padded for single digits. For example: * 03 = March * 11 = November") + @ApiModelProperty(value = "The card expiry month. Format: 2 digits, zero-padded for single digits. For example: * 03 = March * 11 = November") public String getExpiryMonth() { return expiryMonth; @@ -137,7 +137,7 @@ public Card expiryYear(String expiryYear) { * The card expiry year. Format: 4 digits. For example: 2020 * @return expiryYear **/ - @ApiModelProperty(required = true, value = "The card expiry year. Format: 4 digits. For example: 2020") + @ApiModelProperty(value = "The card expiry year. Format: 4 digits. For example: 2020") public String getExpiryYear() { return expiryYear; @@ -159,7 +159,7 @@ public Card holderName(String holderName) { * The name of the cardholder, as printed on the card. * @return holderName **/ - @ApiModelProperty(required = true, value = "The name of the cardholder, as printed on the card.") + @ApiModelProperty(value = "The name of the cardholder, as printed on the card.") public String getHolderName() { return holderName; @@ -203,7 +203,7 @@ public Card number(String number) { * The card number (4-19 characters). Do not use any separators. When this value is returned in a response, only the last 4 digits of the card number are returned. * @return number **/ - @ApiModelProperty(required = true, value = "The card number (4-19 characters). Do not use any separators. When this value is returned in a response, only the last 4 digits of the card number are returned.") + @ApiModelProperty(value = "The card number (4-19 characters). Do not use any separators. When this value is returned in a response, only the last 4 digits of the card number are returned.") public String getNumber() { return number; @@ -329,10 +329,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("expiryMonth"); - openapiRequiredFields.add("expiryYear"); - openapiRequiredFields.add("holderName"); - openapiRequiredFields.add("number"); } /** @@ -357,13 +353,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Card` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Card.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } // validate the optional field cvc if (jsonObj.get("cvc") != null && !jsonObj.get("cvc").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `cvc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvc").toString())); diff --git a/src/main/java/com/adyen/model/payout/FraudCheckResultWrapper.java b/src/main/java/com/adyen/model/payout/FraudCheckResultWrapper.java new file mode 100644 index 000000000..b5c1a9d12 --- /dev/null +++ b/src/main/java/com/adyen/model/payout/FraudCheckResultWrapper.java @@ -0,0 +1,209 @@ +/* + * Adyen Payout API + * + * The version of the OpenAPI document: 68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.payout; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.payout.FraudCheckResult; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.payout.JSON; + +/** + * FraudCheckResultWrapper + */ + +public class FraudCheckResultWrapper { + public static final String SERIALIZED_NAME_FRAUD_CHECK_RESULT = "FraudCheckResult"; + @SerializedName(SERIALIZED_NAME_FRAUD_CHECK_RESULT) + private FraudCheckResult fraudCheckResult; + + public FraudCheckResultWrapper() { + } + + public FraudCheckResultWrapper fraudCheckResult(FraudCheckResult fraudCheckResult) { + + this.fraudCheckResult = fraudCheckResult; + return this; + } + + /** + * Get fraudCheckResult + * @return fraudCheckResult + **/ + @ApiModelProperty(value = "") + + public FraudCheckResult getFraudCheckResult() { + return fraudCheckResult; + } + + + public void setFraudCheckResult(FraudCheckResult fraudCheckResult) { + this.fraudCheckResult = fraudCheckResult; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FraudCheckResultWrapper fraudCheckResultWrapper = (FraudCheckResultWrapper) o; + return Objects.equals(this.fraudCheckResult, fraudCheckResultWrapper.fraudCheckResult); + } + + @Override + public int hashCode() { + return Objects.hash(fraudCheckResult); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FraudCheckResultWrapper {\n"); + sb.append(" fraudCheckResult: ").append(toIndentedString(fraudCheckResult)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("FraudCheckResult"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FraudCheckResultWrapper + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FraudCheckResultWrapper.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FraudCheckResultWrapper is not found in the empty JSON string", FraudCheckResultWrapper.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FraudCheckResultWrapper.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FraudCheckResultWrapper` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `FraudCheckResult` + if (jsonObj.getAsJsonObject("FraudCheckResult") != null) { + FraudCheckResult.validateJsonObject(jsonObj.getAsJsonObject("FraudCheckResult")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FraudCheckResultWrapper.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FraudCheckResultWrapper' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FraudCheckResultWrapper.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FraudCheckResultWrapper value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FraudCheckResultWrapper read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FraudCheckResultWrapper given an JSON string + * + * @param jsonString JSON string + * @return An instance of FraudCheckResultWrapper + * @throws IOException if the JSON string is invalid with respect to FraudCheckResultWrapper + */ + public static FraudCheckResultWrapper fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FraudCheckResultWrapper.class); + } + + /** + * Convert an instance of FraudCheckResultWrapper to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/payout/FraudResult.java b/src/main/java/com/adyen/model/payout/FraudResult.java index 7edf1f9ff..7b0c8a137 100644 --- a/src/main/java/com/adyen/model/payout/FraudResult.java +++ b/src/main/java/com/adyen/model/payout/FraudResult.java @@ -14,7 +14,7 @@ import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payout.FraudCheckResult; +import com.adyen.model.payout.FraudCheckResultWrapper; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -57,7 +57,7 @@ public class FraudResult { public static final String SERIALIZED_NAME_RESULTS = "results"; @SerializedName(SERIALIZED_NAME_RESULTS) - private List results = null; + private List results = null; public FraudResult() { } @@ -84,13 +84,13 @@ public void setAccountScore(Integer accountScore) { } - public FraudResult results(List results) { + public FraudResult results(List results) { this.results = results; return this; } - public FraudResult addResultsItem(FraudCheckResult resultsItem) { + public FraudResult addResultsItem(FraudCheckResultWrapper resultsItem) { if (this.results == null) { this.results = new ArrayList<>(); } @@ -104,12 +104,12 @@ public FraudResult addResultsItem(FraudCheckResult resultsItem) { **/ @ApiModelProperty(value = "The result of the individual risk checks.") - public List getResults() { + public List getResults() { return results; } - public void setResults(List results) { + public void setResults(List results) { this.results = results; } @@ -207,7 +207,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `results` (array) for (int i = 0; i < jsonArrayresults.size(); i++) { - FraudCheckResult.validateJsonObject(jsonArrayresults.get(i).getAsJsonObject()); + FraudCheckResultWrapper.validateJsonObject(jsonArrayresults.get(i).getAsJsonObject()); }; } } diff --git a/src/main/java/com/adyen/model/payout/JSON.java b/src/main/java/com/adyen/model/payout/JSON.java index e4cea07b0..bfcdc59e5 100644 --- a/src/main/java/com/adyen/model/payout/JSON.java +++ b/src/main/java/com/adyen/model/payout/JSON.java @@ -97,6 +97,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payout.BankAccount.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payout.Card.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payout.FraudCheckResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payout.FraudCheckResultWrapper.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payout.FraudResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payout.FundSource.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payout.ModifyRequest.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitRequest.java b/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitRequest.java index 3d25eff3e..51685a38d 100644 --- a/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitRequest.java +++ b/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitRequest.java @@ -28,7 +28,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.time.OffsetDateTime; +import java.time.LocalDate; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -80,7 +80,7 @@ public class StoreDetailAndSubmitRequest { public static final String SERIALIZED_NAME_DATE_OF_BIRTH = "dateOfBirth"; @SerializedName(SERIALIZED_NAME_DATE_OF_BIRTH) - private OffsetDateTime dateOfBirth; + private LocalDate dateOfBirth; /** * The type of the entity the payout is processed for. @@ -302,7 +302,7 @@ public void setCard(Card card) { } - public StoreDetailAndSubmitRequest dateOfBirth(OffsetDateTime dateOfBirth) { + public StoreDetailAndSubmitRequest dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; return this; @@ -314,12 +314,12 @@ public StoreDetailAndSubmitRequest dateOfBirth(OffsetDateTime dateOfBirth) { **/ @ApiModelProperty(required = true, value = "The date of birth. Format: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD For Paysafecard it must be the same as used when registering the Paysafecard account. > This field is mandatory for natural persons.") - public OffsetDateTime getDateOfBirth() { + public LocalDate getDateOfBirth() { return dateOfBirth; } - public void setDateOfBirth(OffsetDateTime dateOfBirth) { + public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; } diff --git a/src/main/java/com/adyen/model/payout/StoreDetailRequest.java b/src/main/java/com/adyen/model/payout/StoreDetailRequest.java index ba14baa28..2c3dd37c8 100644 --- a/src/main/java/com/adyen/model/payout/StoreDetailRequest.java +++ b/src/main/java/com/adyen/model/payout/StoreDetailRequest.java @@ -27,7 +27,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.time.OffsetDateTime; +import java.time.LocalDate; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -75,7 +75,7 @@ public class StoreDetailRequest { public static final String SERIALIZED_NAME_DATE_OF_BIRTH = "dateOfBirth"; @SerializedName(SERIALIZED_NAME_DATE_OF_BIRTH) - private OffsetDateTime dateOfBirth; + private LocalDate dateOfBirth; /** * The type of the entity the payout is processed for. @@ -267,7 +267,7 @@ public void setCard(Card card) { } - public StoreDetailRequest dateOfBirth(OffsetDateTime dateOfBirth) { + public StoreDetailRequest dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; return this; @@ -279,12 +279,12 @@ public StoreDetailRequest dateOfBirth(OffsetDateTime dateOfBirth) { **/ @ApiModelProperty(required = true, value = "The date of birth. Format: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD For Paysafecard it must be the same as used when registering the Paysafecard account. > This field is mandatory for natural persons.") - public OffsetDateTime getDateOfBirth() { + public LocalDate getDateOfBirth() { return dateOfBirth; } - public void setDateOfBirth(OffsetDateTime dateOfBirth) { + public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; } diff --git a/src/main/java/com/adyen/model/payout/SubmitRequest.java b/src/main/java/com/adyen/model/payout/SubmitRequest.java index 36516a0c6..71364bc26 100644 --- a/src/main/java/com/adyen/model/payout/SubmitRequest.java +++ b/src/main/java/com/adyen/model/payout/SubmitRequest.java @@ -25,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.time.OffsetDateTime; +import java.time.LocalDate; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -65,7 +65,7 @@ public class SubmitRequest { public static final String SERIALIZED_NAME_DATE_OF_BIRTH = "dateOfBirth"; @SerializedName(SERIALIZED_NAME_DATE_OF_BIRTH) - private OffsetDateTime dateOfBirth; + private LocalDate dateOfBirth; /** * The type of the entity the payout is processed for. Allowed values: * NaturalPerson * Company > This field is required to update the existing `entityType` that is associated with this recurring contract. @@ -217,7 +217,7 @@ public void setAmount(Amount amount) { } - public SubmitRequest dateOfBirth(OffsetDateTime dateOfBirth) { + public SubmitRequest dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; return this; @@ -229,12 +229,12 @@ public SubmitRequest dateOfBirth(OffsetDateTime dateOfBirth) { **/ @ApiModelProperty(value = "The date of birth. Format: ISO-8601; example: YYYY-MM-DD For Paysafecard it must be the same as used when registering the Paysafecard account. > This field is mandatory for natural persons. > This field is required to update the existing `dateOfBirth` that is associated with this recurring contract.") - public OffsetDateTime getDateOfBirth() { + public LocalDate getDateOfBirth() { return dateOfBirth; } - public void setDateOfBirth(OffsetDateTime dateOfBirth) { + public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; } diff --git a/src/main/java/com/adyen/model/storedvalue/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/storedvalue/AbstractOpenApiSchema.java new file mode 100644 index 000000000..077a73f02 --- /dev/null +++ b/src/main/java/com/adyen/model/storedvalue/AbstractOpenApiSchema.java @@ -0,0 +1,145 @@ +/* + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. + * + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.storedvalue; + +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import jakarta.ws.rs.core.GenericType; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/src/main/java/com/adyen/model/storedvalue/Amount.java b/src/main/java/com/adyen/model/storedvalue/Amount.java index 62173ff19..ef2799618 100644 --- a/src/main/java/com/adyen/model/storedvalue/Amount.java +++ b/src/main/java/com/adyen/model/storedvalue/Amount.java @@ -1,117 +1,247 @@ -/** - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ +/* + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. * - * Adyen Java API Library + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.storedvalue; -import com.adyen.util.Util; -import com.google.gson.annotations.SerializedName; +package com.adyen.model.storedvalue; -import java.math.BigDecimal; import java.util.Objects; - -import static com.adyen.util.Util.toIndentedString; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.storedvalue.JSON; /** * Amount */ + public class Amount { - @SerializedName("value") - private Long value = null; + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; - @SerializedName("currency") - private String currency = null; + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private Long value; + public Amount() { + } + + public Amount currency(String currency) { - public BigDecimal getDecimalValue() { - return BigDecimal.valueOf(getValue(), Util.getDecimalPlaces(getCurrency())); - } + this.currency = currency; + return this; + } - public Amount value(Long value) { - this.value = value; - return this; - } + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @return currency + **/ + @ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).") - /** - * the amount's value in minor units - * - * @return value - **/ - public Long getValue() { - return value; - } + public String getCurrency() { + return currency; + } - public void setValue(Long value) { - this.value = value; - } - public Amount currency(String currency) { - this.currency = currency; - return this; - } + public void setCurrency(String currency) { + this.currency = currency; + } - /** - * the amount's three letter currency code (ISO 4217) - * - * @return currency - **/ - public String getCurrency() { - return currency; - } - public void setCurrency(String currency) { - this.currency = currency; - } + public Amount value(Long value) { + + this.value = value; + return this; + } + /** + * The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * @return value + **/ + @ApiModelProperty(required = true, value = "The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).") - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Amount amount = (Amount) o; - return Objects.equals(this.value, amount.value) && - Objects.equals(this.currency, amount.currency); - } + public Long getValue() { + return value; + } - @Override - public int hashCode() { - return Objects.hash(value, currency); - } + + public void setValue(Long value) { + this.value = value; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Amount {\n"); - - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); - sb.append("}"); - return sb.toString(); - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Amount amount = (Amount) o; + return Objects.equals(this.currency, amount.currency) && + Objects.equals(this.value, amount.value); + } + + @Override + public int hashCode() { + return Objects.hash(currency, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Amount {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("currency"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("currency"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Amount + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Amount.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Amount is not found in the empty JSON string", Amount.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Amount.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Amount` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Amount.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field currency + if (jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Amount.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Amount' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Amount.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Amount value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Amount read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Amount given an JSON string + * + * @param jsonString JSON string + * @return An instance of Amount + * @throws IOException if the JSON string is invalid with respect to Amount + */ + public static Amount fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Amount.class); + } + + /** + * Convert an instance of Amount to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/src/main/java/com/adyen/model/storedvalue/JSON.java b/src/main/java/com/adyen/model/storedvalue/JSON.java new file mode 100644 index 000000000..6d3ad8dac --- /dev/null +++ b/src/main/java/com/adyen/model/storedvalue/JSON.java @@ -0,0 +1,413 @@ +/* + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. + * + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.storedvalue; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import org.apache.commons.codec.binary.Base64; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.storedvalue.Amount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.storedvalue.ServiceError.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.storedvalue.StoredValueBalanceCheckRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.storedvalue.StoredValueBalanceCheckResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.storedvalue.StoredValueBalanceMergeRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.storedvalue.StoredValueBalanceMergeResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.storedvalue.StoredValueIssueRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.storedvalue.StoredValueIssueResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.storedvalue.StoredValueLoadRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.storedvalue.StoredValueLoadResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.storedvalue.StoredValueStatusChangeRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.storedvalue.StoredValueStatusChangeResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.storedvalue.StoredValueVoidRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.storedvalue.StoredValueVoidResponse.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(new String(value)); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + return Base64.decodeBase64(bytesAsBase64); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/src/main/java/com/adyen/model/storedvalue/ServiceError.java b/src/main/java/com/adyen/model/storedvalue/ServiceError.java new file mode 100644 index 000000000..b01746dd1 --- /dev/null +++ b/src/main/java/com/adyen/model/storedvalue/ServiceError.java @@ -0,0 +1,377 @@ +/* + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. + * + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.storedvalue; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.storedvalue.JSON; + +/** + * ServiceError + */ + +public class ServiceError { + public static final String SERIALIZED_NAME_ADDITIONAL_DATA = "additionalData"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_DATA) + private Map additionalData = null; + + public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode"; + @SerializedName(SERIALIZED_NAME_ERROR_CODE) + private String errorCode; + + public static final String SERIALIZED_NAME_ERROR_TYPE = "errorType"; + @SerializedName(SERIALIZED_NAME_ERROR_TYPE) + private String errorType; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_PSP_REFERENCE = "pspReference"; + @SerializedName(SERIALIZED_NAME_PSP_REFERENCE) + private String pspReference; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Integer status; + + public ServiceError() { + } + + public ServiceError additionalData(Map additionalData) { + + this.additionalData = additionalData; + return this; + } + + public ServiceError putAdditionalDataItem(String key, String additionalDataItem) { + if (this.additionalData == null) { + this.additionalData = new HashMap<>(); + } + this.additionalData.put(key, additionalDataItem); + return this; + } + + /** + * Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**. + * @return additionalData + **/ + @ApiModelProperty(value = "Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**.") + + public Map getAdditionalData() { + return additionalData; + } + + + public void setAdditionalData(Map additionalData) { + this.additionalData = additionalData; + } + + + public ServiceError errorCode(String errorCode) { + + this.errorCode = errorCode; + return this; + } + + /** + * The error code mapped to the error message. + * @return errorCode + **/ + @ApiModelProperty(value = "The error code mapped to the error message.") + + public String getErrorCode() { + return errorCode; + } + + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + + public ServiceError errorType(String errorType) { + + this.errorType = errorType; + return this; + } + + /** + * The category of the error. + * @return errorType + **/ + @ApiModelProperty(value = "The category of the error.") + + public String getErrorType() { + return errorType; + } + + + public void setErrorType(String errorType) { + this.errorType = errorType; + } + + + public ServiceError message(String message) { + + this.message = message; + return this; + } + + /** + * A short explanation of the issue. + * @return message + **/ + @ApiModelProperty(value = "A short explanation of the issue.") + + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ServiceError pspReference(String pspReference) { + + this.pspReference = pspReference; + return this; + } + + /** + * The PSP reference of the payment. + * @return pspReference + **/ + @ApiModelProperty(value = "The PSP reference of the payment.") + + public String getPspReference() { + return pspReference; + } + + + public void setPspReference(String pspReference) { + this.pspReference = pspReference; + } + + + public ServiceError status(Integer status) { + + this.status = status; + return this; + } + + /** + * The HTTP response status. + * @return status + **/ + @ApiModelProperty(value = "The HTTP response status.") + + public Integer getStatus() { + return status; + } + + + public void setStatus(Integer status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceError serviceError = (ServiceError) o; + return Objects.equals(this.additionalData, serviceError.additionalData) && + Objects.equals(this.errorCode, serviceError.errorCode) && + Objects.equals(this.errorType, serviceError.errorType) && + Objects.equals(this.message, serviceError.message) && + Objects.equals(this.pspReference, serviceError.pspReference) && + Objects.equals(this.status, serviceError.status); + } + + @Override + public int hashCode() { + return Objects.hash(additionalData, errorCode, errorType, message, pspReference, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceError {\n"); + sb.append(" additionalData: ").append(toIndentedString(additionalData)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" errorType: ").append(toIndentedString(errorType)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("additionalData"); + openapiFields.add("errorCode"); + openapiFields.add("errorType"); + openapiFields.add("message"); + openapiFields.add("pspReference"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ServiceError + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ServiceError.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ServiceError is not found in the empty JSON string", ServiceError.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ServiceError.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ServiceError` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field errorCode + if (jsonObj.get("errorCode") != null && !jsonObj.get("errorCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); + } + // validate the optional field errorType + if (jsonObj.get("errorType") != null && !jsonObj.get("errorType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorType").toString())); + } + // validate the optional field message + if (jsonObj.get("message") != null && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the optional field pspReference + if (jsonObj.get("pspReference") != null && !jsonObj.get("pspReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ServiceError.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ServiceError' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ServiceError.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ServiceError value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ServiceError read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ServiceError given an JSON string + * + * @param jsonString JSON string + * @return An instance of ServiceError + * @throws IOException if the JSON string is invalid with respect to ServiceError + */ + public static ServiceError fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ServiceError.class); + } + + /** + * Convert an instance of ServiceError to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java old mode 100755 new mode 100644 index 1b649ce79..f233e5209 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java @@ -1,312 +1,509 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. * - * Adyen Java API Library + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.storedvalue; -import java.util.Objects; -import com.adyen.model.checkout.PaymentMethod; +package com.adyen.model.storedvalue; +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.storedvalue.Amount; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; - +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.storedvalue.JSON; /** * StoredValueBalanceCheckRequest */ public class StoredValueBalanceCheckRequest { - @SerializedName("amount") - private Amount amount = null; + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; + + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT = "merchantAccount"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) + private String merchantAccount; + + public static final String SERIALIZED_NAME_PAYMENT_METHOD = "paymentMethod"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) + private Map paymentMethod = new HashMap<>(); + + public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) + private String recurringDetailReference; + + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; + + /** + * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + */ + @JsonAdapter(ShopperInteractionEnum.Adapter.class) + public enum ShopperInteractionEnum { + ECOMMERCE("Ecommerce"), + + CONTAUTH("ContAuth"), + + MOTO("Moto"), + + POS("POS"); + + private String value; + + ShopperInteractionEnum(String value) { + this.value = value; + } - @SerializedName("merchantAccount") - private String merchantAccount = null; + public String getValue() { + return value; + } - @SerializedName("paymentMethod") - private PaymentMethod paymentMethod = null; + @Override + public String toString() { + return String.valueOf(value); + } - @SerializedName("recurringDetailReference") - private String recurringDetailReference = null; + public static ShopperInteractionEnum fromValue(String value) { + for (ShopperInteractionEnum b : ShopperInteractionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - @SerializedName("reference") - private String reference = null; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ShopperInteractionEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ShopperInteractionEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_SHOPPER_INTERACTION = "shopperInteraction"; + @SerializedName(SERIALIZED_NAME_SHOPPER_INTERACTION) + private ShopperInteractionEnum shopperInteraction; - /** - * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - */ - @JsonAdapter(ShopperInteractionEnum.Adapter.class) - public enum ShopperInteractionEnum { - ECOMMERCE("Ecommerce"), - CONTAUTH("ContAuth"), - MOTO("Moto"), - POS("POS"); + public static final String SERIALIZED_NAME_SHOPPER_REFERENCE = "shopperReference"; + @SerializedName(SERIALIZED_NAME_SHOPPER_REFERENCE) + private String shopperReference; + public static final String SERIALIZED_NAME_STORE = "store"; + @SerializedName(SERIALIZED_NAME_STORE) + private String store; - private final String value; + public StoredValueBalanceCheckRequest() { + } - ShopperInteractionEnum(String value) { - this.value = value; - } + public StoredValueBalanceCheckRequest amount(Amount amount) { + + this.amount = amount; + return this; + } - public String getValue() { - return value; - } + /** + * Get amount + * @return amount + **/ + @ApiModelProperty(value = "") - @Override - public String toString() { - return String.valueOf(value); - } + public Amount getAmount() { + return amount; + } - public static ShopperInteractionEnum fromValue(String text) { - for (ShopperInteractionEnum b : ShopperInteractionEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ShopperInteractionEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ShopperInteractionEnum.fromValue(String.valueOf(value)); - } - } - } + public void setAmount(Amount amount) { + this.amount = amount; + } - @SerializedName("shopperInteraction") - private ShopperInteractionEnum shopperInteraction = null; - @SerializedName("shopperReference") - private String shopperReference = null; + public StoredValueBalanceCheckRequest merchantAccount(String merchantAccount) { + + this.merchantAccount = merchantAccount; + return this; + } - @SerializedName("store") - private String store = null; + /** + * The merchant account identifier, with which you want to process the transaction. + * @return merchantAccount + **/ + @ApiModelProperty(required = true, value = "The merchant account identifier, with which you want to process the transaction.") - public StoredValueBalanceCheckRequest amount(Amount amount) { - this.amount = amount; - return this; - } + public String getMerchantAccount() { + return merchantAccount; + } - /** - * Get amount - * - * @return amount - **/ - public Amount getAmount() { - return amount; - } - public void setAmount(Amount amount) { - this.amount = amount; - } + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } - public StoredValueBalanceCheckRequest merchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - return this; - } - /** - * The merchant account identifier, with which you want to process the transaction. - * - * @return merchantAccount - **/ - public String getMerchantAccount() { - return merchantAccount; - } + public StoredValueBalanceCheckRequest paymentMethod(Map paymentMethod) { + + this.paymentMethod = paymentMethod; + return this; + } - public void setMerchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - } + public StoredValueBalanceCheckRequest putPaymentMethodItem(String key, String paymentMethodItem) { + this.paymentMethod.put(key, paymentMethodItem); + return this; + } - public StoredValueBalanceCheckRequest paymentMethod(PaymentMethod paymentMethod) { - this.paymentMethod = paymentMethod; - return this; - } + /** + * The collection that contains the type of the payment method and its specific information if available + * @return paymentMethod + **/ + @ApiModelProperty(required = true, value = "The collection that contains the type of the payment method and its specific information if available") - /** - * The collection that contains the type of the payment method and its specific information if available - * - * @return paymentMethod - **/ - public PaymentMethod getPaymentMethod() { - return paymentMethod; - } + public Map getPaymentMethod() { + return paymentMethod; + } - public void setPaymentMethod(PaymentMethod paymentMethod) { - this.paymentMethod = paymentMethod; - } - public StoredValueBalanceCheckRequest recurringDetailReference(String recurringDetailReference) { - this.recurringDetailReference = recurringDetailReference; - return this; - } + public void setPaymentMethod(Map paymentMethod) { + this.paymentMethod = paymentMethod; + } - /** - * Get recurringDetailReference - * - * @return recurringDetailReference - **/ - public String getRecurringDetailReference() { - return recurringDetailReference; - } - public void setRecurringDetailReference(String recurringDetailReference) { - this.recurringDetailReference = recurringDetailReference; - } + public StoredValueBalanceCheckRequest recurringDetailReference(String recurringDetailReference) { + + this.recurringDetailReference = recurringDetailReference; + return this; + } - public StoredValueBalanceCheckRequest reference(String reference) { - this.reference = reference; - return this; - } + /** + * Get recurringDetailReference + * @return recurringDetailReference + **/ + @ApiModelProperty(value = "") - /** - * The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - * - * @return reference - **/ - public String getReference() { - return reference; - } + public String getRecurringDetailReference() { + return recurringDetailReference; + } - public void setReference(String reference) { - this.reference = reference; - } - public StoredValueBalanceCheckRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { - this.shopperInteraction = shopperInteraction; - return this; - } + public void setRecurringDetailReference(String recurringDetailReference) { + this.recurringDetailReference = recurringDetailReference; + } - /** - * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - * - * @return shopperInteraction - **/ - public ShopperInteractionEnum getShopperInteraction() { - return shopperInteraction; - } - public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { - this.shopperInteraction = shopperInteraction; - } + public StoredValueBalanceCheckRequest reference(String reference) { + + this.reference = reference; + return this; + } - public StoredValueBalanceCheckRequest shopperReference(String shopperReference) { - this.shopperReference = shopperReference; - return this; - } + /** + * The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + * @return reference + **/ + @ApiModelProperty(required = true, value = "The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.") - /** - * Get shopperReference - * - * @return shopperReference - **/ - public String getShopperReference() { - return shopperReference; - } + public String getReference() { + return reference; + } - public void setShopperReference(String shopperReference) { - this.shopperReference = shopperReference; - } - public StoredValueBalanceCheckRequest store(String store) { - this.store = store; - return this; - } + public void setReference(String reference) { + this.reference = reference; + } - /** - * The physical store, for which this payment is processed. - * - * @return store - **/ - public String getStore() { - return store; - } - public void setStore(String store) { - this.store = store; - } + public StoredValueBalanceCheckRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { + + this.shopperInteraction = shopperInteraction; + return this; + } + /** + * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + * @return shopperInteraction + **/ + @ApiModelProperty(value = "Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.") - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StoredValueBalanceCheckRequest storedValueBalanceCheckRequest = (StoredValueBalanceCheckRequest) o; - return Objects.equals(this.amount, storedValueBalanceCheckRequest.amount) && - Objects.equals(this.merchantAccount, storedValueBalanceCheckRequest.merchantAccount) && - Objects.equals(this.paymentMethod, storedValueBalanceCheckRequest.paymentMethod) && - Objects.equals(this.recurringDetailReference, storedValueBalanceCheckRequest.recurringDetailReference) && - Objects.equals(this.reference, storedValueBalanceCheckRequest.reference) && - Objects.equals(this.shopperInteraction, storedValueBalanceCheckRequest.shopperInteraction) && - Objects.equals(this.shopperReference, storedValueBalanceCheckRequest.shopperReference) && - Objects.equals(this.store, storedValueBalanceCheckRequest.store); - } + public ShopperInteractionEnum getShopperInteraction() { + return shopperInteraction; + } - @Override - public int hashCode() { - return Objects.hash(amount, merchantAccount, paymentMethod, recurringDetailReference, reference, shopperInteraction, shopperReference, store); - } + public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { + this.shopperInteraction = shopperInteraction; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StoredValueBalanceCheckRequest {\n"); - - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); - sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); - sb.append(" recurringDetailReference: ").append(toIndentedString(recurringDetailReference)).append("\n"); - sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); - sb.append(" shopperInteraction: ").append(toIndentedString(shopperInteraction)).append("\n"); - sb.append(" shopperReference: ").append(toIndentedString(shopperReference)).append("\n"); - sb.append(" store: ").append(toIndentedString(store)).append("\n"); - sb.append("}"); - return sb.toString(); + + public StoredValueBalanceCheckRequest shopperReference(String shopperReference) { + + this.shopperReference = shopperReference; + return this; + } + + /** + * Get shopperReference + * @return shopperReference + **/ + @ApiModelProperty(value = "") + + public String getShopperReference() { + return shopperReference; + } + + + public void setShopperReference(String shopperReference) { + this.shopperReference = shopperReference; + } + + + public StoredValueBalanceCheckRequest store(String store) { + + this.store = store; + return this; + } + + /** + * The physical store, for which this payment is processed. + * @return store + **/ + @ApiModelProperty(value = "The physical store, for which this payment is processed.") + + public String getStore() { + return store; + } + + + public void setStore(String store) { + this.store = store; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueBalanceCheckRequest storedValueBalanceCheckRequest = (StoredValueBalanceCheckRequest) o; + return Objects.equals(this.amount, storedValueBalanceCheckRequest.amount) && + Objects.equals(this.merchantAccount, storedValueBalanceCheckRequest.merchantAccount) && + Objects.equals(this.paymentMethod, storedValueBalanceCheckRequest.paymentMethod) && + Objects.equals(this.recurringDetailReference, storedValueBalanceCheckRequest.recurringDetailReference) && + Objects.equals(this.reference, storedValueBalanceCheckRequest.reference) && + Objects.equals(this.shopperInteraction, storedValueBalanceCheckRequest.shopperInteraction) && + Objects.equals(this.shopperReference, storedValueBalanceCheckRequest.shopperReference) && + Objects.equals(this.store, storedValueBalanceCheckRequest.store); + } + + @Override + public int hashCode() { + return Objects.hash(amount, merchantAccount, paymentMethod, recurringDetailReference, reference, shopperInteraction, shopperReference, store); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueBalanceCheckRequest {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); + sb.append(" recurringDetailReference: ").append(toIndentedString(recurringDetailReference)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" shopperInteraction: ").append(toIndentedString(shopperInteraction)).append("\n"); + sb.append(" shopperReference: ").append(toIndentedString(shopperReference)).append("\n"); + sb.append(" store: ").append(toIndentedString(store)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("amount"); + openapiFields.add("merchantAccount"); + openapiFields.add("paymentMethod"); + openapiFields.add("recurringDetailReference"); + openapiFields.add("reference"); + openapiFields.add("shopperInteraction"); + openapiFields.add("shopperReference"); + openapiFields.add("store"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("merchantAccount"); + openapiRequiredFields.add("paymentMethod"); + openapiRequiredFields.add("reference"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StoredValueBalanceCheckRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (StoredValueBalanceCheckRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in StoredValueBalanceCheckRequest is not found in the empty JSON string", StoredValueBalanceCheckRequest.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StoredValueBalanceCheckRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredValueBalanceCheckRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - return o.toString().replace("\n", "\n "); - } + } + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StoredValueBalanceCheckRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + // validate the optional field merchantAccount + if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); + } + // validate the optional field recurringDetailReference + if (jsonObj.get("recurringDetailReference") != null && !jsonObj.get("recurringDetailReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringDetailReference").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + // ensure the field shopperInteraction can be parsed to an enum value + if (jsonObj.get("shopperInteraction") != null) { + if(!jsonObj.get("shopperInteraction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shopperInteraction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperInteraction").toString())); + } + ShopperInteractionEnum.fromValue(jsonObj.get("shopperInteraction").getAsString()); + } + // validate the optional field shopperReference + if (jsonObj.get("shopperReference") != null && !jsonObj.get("shopperReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperReference").toString())); + } + // validate the optional field store + if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StoredValueBalanceCheckRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StoredValueBalanceCheckRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StoredValueBalanceCheckRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StoredValueBalanceCheckRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StoredValueBalanceCheckRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StoredValueBalanceCheckRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueBalanceCheckRequest + * @throws IOException if the JSON string is invalid with respect to StoredValueBalanceCheckRequest + */ + public static StoredValueBalanceCheckRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StoredValueBalanceCheckRequest.class); + } + + /** + * Convert an instance of StoredValueBalanceCheckRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java old mode 100755 new mode 100644 index 040aa36d4..8fe4aa60d --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java @@ -1,240 +1,396 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. * - * Adyen Java API Library + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.storedvalue; import java.util.Objects; - +import java.util.Arrays; +import com.adyen.model.storedvalue.Amount; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; - +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.storedvalue.JSON; + /** * StoredValueBalanceCheckResponse */ public class StoredValueBalanceCheckResponse { - @SerializedName("currentBalance") - private Amount currentBalance = null; + public static final String SERIALIZED_NAME_CURRENT_BALANCE = "currentBalance"; + @SerializedName(SERIALIZED_NAME_CURRENT_BALANCE) + private Amount currentBalance; + + public static final String SERIALIZED_NAME_PSP_REFERENCE = "pspReference"; + @SerializedName(SERIALIZED_NAME_PSP_REFERENCE) + private String pspReference; + + public static final String SERIALIZED_NAME_REFUSAL_REASON = "refusalReason"; + @SerializedName(SERIALIZED_NAME_REFUSAL_REASON) + private String refusalReason; + + /** + * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + */ + @JsonAdapter(ResultCodeEnum.Adapter.class) + public enum ResultCodeEnum { + SUCCESS("Success"), + + REFUSED("Refused"), + + ERROR("Error"), + + NOTENOUGHBALANCE("NotEnoughBalance"); + + private String value; + + ResultCodeEnum(String value) { + this.value = value; + } - @SerializedName("pspReference") - private String pspReference = null; + public String getValue() { + return value; + } - @SerializedName("refusalReason") - private String refusalReason = null; + @Override + public String toString() { + return String.valueOf(value); + } - /** - * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. - */ - @JsonAdapter(ResultCodeEnum.Adapter.class) - public enum ResultCodeEnum { - SUCCESS("Success"), - REFUSED("Refused"), - ERROR("Error"), - NOTENOUGHBALANCE("NotEnoughBalance"); + public static ResultCodeEnum fromValue(String value) { + for (ResultCodeEnum b : ResultCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResultCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResultCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResultCodeEnum.fromValue(value); + } + } + } - private final String value; + public static final String SERIALIZED_NAME_RESULT_CODE = "resultCode"; + @SerializedName(SERIALIZED_NAME_RESULT_CODE) + private ResultCodeEnum resultCode; - ResultCodeEnum(String value) { - this.value = value; - } + public static final String SERIALIZED_NAME_THIRD_PARTY_REFUSAL_REASON = "thirdPartyRefusalReason"; + @SerializedName(SERIALIZED_NAME_THIRD_PARTY_REFUSAL_REASON) + private String thirdPartyRefusalReason; - public String getValue() { - return value; - } + public StoredValueBalanceCheckResponse() { + } - @Override - public String toString() { - return String.valueOf(value); - } + public StoredValueBalanceCheckResponse currentBalance(Amount currentBalance) { + + this.currentBalance = currentBalance; + return this; + } - public static ResultCodeEnum fromValue(String text) { - for (ResultCodeEnum b : ResultCodeEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } + /** + * Get currentBalance + * @return currentBalance + **/ + @ApiModelProperty(value = "") - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResultCodeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ResultCodeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResultCodeEnum.fromValue(String.valueOf(value)); - } - } - } + public Amount getCurrentBalance() { + return currentBalance; + } - @SerializedName("resultCode") - private ResultCodeEnum resultCode = null; - @SerializedName("thirdPartyRefusalReason") - private String thirdPartyRefusalReason = null; + public void setCurrentBalance(Amount currentBalance) { + this.currentBalance = currentBalance; + } - public StoredValueBalanceCheckResponse currentBalance(Amount currentBalance) { - this.currentBalance = currentBalance; - return this; - } - /** - * Get currentBalance - * - * @return currentBalance - **/ - public Amount getCurrentBalance() { - return currentBalance; - } + public StoredValueBalanceCheckResponse pspReference(String pspReference) { + + this.pspReference = pspReference; + return this; + } - public void setCurrentBalance(Amount currentBalance) { - this.currentBalance = currentBalance; - } + /** + * Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + * @return pspReference + **/ + @ApiModelProperty(value = "Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request.") - public StoredValueBalanceCheckResponse pspReference(String pspReference) { - this.pspReference = pspReference; - return this; - } + public String getPspReference() { + return pspReference; + } - /** - * Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - * - * @return pspReference - **/ - public String getPspReference() { - return pspReference; - } - public void setPspReference(String pspReference) { - this.pspReference = pspReference; - } + public void setPspReference(String pspReference) { + this.pspReference = pspReference; + } - public StoredValueBalanceCheckResponse refusalReason(String refusalReason) { - this.refusalReason = refusalReason; - return this; - } - /** - * If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. - * - * @return refusalReason - **/ - public String getRefusalReason() { - return refusalReason; - } + public StoredValueBalanceCheckResponse refusalReason(String refusalReason) { + + this.refusalReason = refusalReason; + return this; + } - public void setRefusalReason(String refusalReason) { - this.refusalReason = refusalReason; - } + /** + * If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. + * @return refusalReason + **/ + @ApiModelProperty(value = "If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values.") - public StoredValueBalanceCheckResponse resultCode(ResultCodeEnum resultCode) { - this.resultCode = resultCode; - return this; - } + public String getRefusalReason() { + return refusalReason; + } - /** - * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. - * - * @return resultCode - **/ - public ResultCodeEnum getResultCode() { - return resultCode; - } - public void setResultCode(ResultCodeEnum resultCode) { - this.resultCode = resultCode; - } + public void setRefusalReason(String refusalReason) { + this.refusalReason = refusalReason; + } - public StoredValueBalanceCheckResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { - this.thirdPartyRefusalReason = thirdPartyRefusalReason; - return this; - } - /** - * Raw refusal reason received from the third party, where available - * - * @return thirdPartyRefusalReason - **/ - public String getThirdPartyRefusalReason() { - return thirdPartyRefusalReason; - } + public StoredValueBalanceCheckResponse resultCode(ResultCodeEnum resultCode) { + + this.resultCode = resultCode; + return this; + } - public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { - this.thirdPartyRefusalReason = thirdPartyRefusalReason; - } + /** + * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + * @return resultCode + **/ + @ApiModelProperty(value = "The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ") + public ResultCodeEnum getResultCode() { + return resultCode; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StoredValueBalanceCheckResponse storedValueBalanceCheckResponse = (StoredValueBalanceCheckResponse) o; - return Objects.equals(this.currentBalance, storedValueBalanceCheckResponse.currentBalance) && - Objects.equals(this.pspReference, storedValueBalanceCheckResponse.pspReference) && - Objects.equals(this.refusalReason, storedValueBalanceCheckResponse.refusalReason) && - Objects.equals(this.resultCode, storedValueBalanceCheckResponse.resultCode) && - Objects.equals(this.thirdPartyRefusalReason, storedValueBalanceCheckResponse.thirdPartyRefusalReason); - } - @Override - public int hashCode() { - return Objects.hash(currentBalance, pspReference, refusalReason, resultCode, thirdPartyRefusalReason); - } + public void setResultCode(ResultCodeEnum resultCode) { + this.resultCode = resultCode; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StoredValueBalanceCheckResponse {\n"); - - sb.append(" currentBalance: ").append(toIndentedString(currentBalance)).append("\n"); - sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); - sb.append(" refusalReason: ").append(toIndentedString(refusalReason)).append("\n"); - sb.append(" resultCode: ").append(toIndentedString(resultCode)).append("\n"); - sb.append(" thirdPartyRefusalReason: ").append(toIndentedString(thirdPartyRefusalReason)).append("\n"); - sb.append("}"); - return sb.toString(); + public StoredValueBalanceCheckResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { + + this.thirdPartyRefusalReason = thirdPartyRefusalReason; + return this; + } + + /** + * Raw refusal reason received from the third party, where available + * @return thirdPartyRefusalReason + **/ + @ApiModelProperty(value = "Raw refusal reason received from the third party, where available") + + public String getThirdPartyRefusalReason() { + return thirdPartyRefusalReason; + } + + + public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { + this.thirdPartyRefusalReason = thirdPartyRefusalReason; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueBalanceCheckResponse storedValueBalanceCheckResponse = (StoredValueBalanceCheckResponse) o; + return Objects.equals(this.currentBalance, storedValueBalanceCheckResponse.currentBalance) && + Objects.equals(this.pspReference, storedValueBalanceCheckResponse.pspReference) && + Objects.equals(this.refusalReason, storedValueBalanceCheckResponse.refusalReason) && + Objects.equals(this.resultCode, storedValueBalanceCheckResponse.resultCode) && + Objects.equals(this.thirdPartyRefusalReason, storedValueBalanceCheckResponse.thirdPartyRefusalReason); + } + + @Override + public int hashCode() { + return Objects.hash(currentBalance, pspReference, refusalReason, resultCode, thirdPartyRefusalReason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueBalanceCheckResponse {\n"); + sb.append(" currentBalance: ").append(toIndentedString(currentBalance)).append("\n"); + sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); + sb.append(" refusalReason: ").append(toIndentedString(refusalReason)).append("\n"); + sb.append(" resultCode: ").append(toIndentedString(resultCode)).append("\n"); + sb.append(" thirdPartyRefusalReason: ").append(toIndentedString(thirdPartyRefusalReason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("currentBalance"); + openapiFields.add("pspReference"); + openapiFields.add("refusalReason"); + openapiFields.add("resultCode"); + openapiFields.add("thirdPartyRefusalReason"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StoredValueBalanceCheckResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (StoredValueBalanceCheckResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in StoredValueBalanceCheckResponse is not found in the empty JSON string", StoredValueBalanceCheckResponse.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StoredValueBalanceCheckResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredValueBalanceCheckResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `currentBalance` + if (jsonObj.getAsJsonObject("currentBalance") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("currentBalance")); + } + // validate the optional field pspReference + if (jsonObj.get("pspReference") != null && !jsonObj.get("pspReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); + } + // validate the optional field refusalReason + if (jsonObj.get("refusalReason") != null && !jsonObj.get("refusalReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReason").toString())); + } + // ensure the field resultCode can be parsed to an enum value + if (jsonObj.get("resultCode") != null) { + if(!jsonObj.get("resultCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `resultCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultCode").toString())); } - return o.toString().replace("\n", "\n "); + ResultCodeEnum.fromValue(jsonObj.get("resultCode").getAsString()); + } + // validate the optional field thirdPartyRefusalReason + if (jsonObj.get("thirdPartyRefusalReason") != null && !jsonObj.get("thirdPartyRefusalReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `thirdPartyRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("thirdPartyRefusalReason").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StoredValueBalanceCheckResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StoredValueBalanceCheckResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StoredValueBalanceCheckResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StoredValueBalanceCheckResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StoredValueBalanceCheckResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); } - + } + + /** + * Create an instance of StoredValueBalanceCheckResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueBalanceCheckResponse + * @throws IOException if the JSON string is invalid with respect to StoredValueBalanceCheckResponse + */ + public static StoredValueBalanceCheckResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StoredValueBalanceCheckResponse.class); + } + + /** + * Convert an instance of StoredValueBalanceCheckResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java old mode 100755 new mode 100644 index 39844b2d3..12d4a5c5e --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java @@ -1,334 +1,544 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. * - * Adyen Java API Library + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.storedvalue; -import java.util.Objects; -import com.adyen.model.checkout.PaymentMethod; +package com.adyen.model.storedvalue; +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.storedvalue.Amount; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; - +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.storedvalue.JSON; /** * StoredValueBalanceMergeRequest */ public class StoredValueBalanceMergeRequest { - @SerializedName("amount") - private Amount amount = null; + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; - @SerializedName("merchantAccount") - private String merchantAccount = null; + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT = "merchantAccount"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) + private String merchantAccount; - @SerializedName("paymentMethod") - private PaymentMethod paymentMethod = null; + public static final String SERIALIZED_NAME_PAYMENT_METHOD = "paymentMethod"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) + private Map paymentMethod = new HashMap<>(); - @SerializedName("recurringDetailReference") - private String recurringDetailReference = null; + public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) + private String recurringDetailReference; - @SerializedName("reference") - private String reference = null; + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; - /** - * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - */ - @JsonAdapter(ShopperInteractionEnum.Adapter.class) - public enum ShopperInteractionEnum { - ECOMMERCE("Ecommerce"), - CONTAUTH("ContAuth"), - MOTO("Moto"), - POS("POS"); + /** + * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + */ + @JsonAdapter(ShopperInteractionEnum.Adapter.class) + public enum ShopperInteractionEnum { + ECOMMERCE("Ecommerce"), + + CONTAUTH("ContAuth"), + + MOTO("Moto"), + + POS("POS"); + private String value; - private final String value; + ShopperInteractionEnum(String value) { + this.value = value; + } - ShopperInteractionEnum(String value) { - this.value = value; - } + public String getValue() { + return value; + } - public String getValue() { - return value; - } + @Override + public String toString() { + return String.valueOf(value); + } - @Override - public String toString() { - return String.valueOf(value); + public static ShopperInteractionEnum fromValue(String value) { + for (ShopperInteractionEnum b : ShopperInteractionEnum.values()) { + if (b.value.equals(value)) { + return b; } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public static ShopperInteractionEnum fromValue(String text) { - for (ShopperInteractionEnum b : ShopperInteractionEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ShopperInteractionEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ShopperInteractionEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ShopperInteractionEnum.fromValue(String.valueOf(value)); - } - } + @Override + public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ShopperInteractionEnum.fromValue(value); + } } + } - @SerializedName("shopperInteraction") - private ShopperInteractionEnum shopperInteraction = null; + public static final String SERIALIZED_NAME_SHOPPER_INTERACTION = "shopperInteraction"; + @SerializedName(SERIALIZED_NAME_SHOPPER_INTERACTION) + private ShopperInteractionEnum shopperInteraction; - @SerializedName("shopperReference") - private String shopperReference = null; + public static final String SERIALIZED_NAME_SHOPPER_REFERENCE = "shopperReference"; + @SerializedName(SERIALIZED_NAME_SHOPPER_REFERENCE) + private String shopperReference; - @SerializedName("sourcePaymentMethod") - private PaymentMethod sourcePaymentMethod = null; + public static final String SERIALIZED_NAME_SOURCE_PAYMENT_METHOD = "sourcePaymentMethod"; + @SerializedName(SERIALIZED_NAME_SOURCE_PAYMENT_METHOD) + private Map sourcePaymentMethod = new HashMap<>(); - @SerializedName("store") - private String store = null; + public static final String SERIALIZED_NAME_STORE = "store"; + @SerializedName(SERIALIZED_NAME_STORE) + private String store; - public StoredValueBalanceMergeRequest amount(Amount amount) { - this.amount = amount; - return this; - } + public StoredValueBalanceMergeRequest() { + } - /** - * Get amount - * - * @return amount - **/ - public Amount getAmount() { - return amount; - } + public StoredValueBalanceMergeRequest amount(Amount amount) { + + this.amount = amount; + return this; + } - public void setAmount(Amount amount) { - this.amount = amount; - } + /** + * Get amount + * @return amount + **/ + @ApiModelProperty(value = "") - public StoredValueBalanceMergeRequest merchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - return this; - } + public Amount getAmount() { + return amount; + } - /** - * The merchant account identifier, with which you want to process the transaction. - * - * @return merchantAccount - **/ - public String getMerchantAccount() { - return merchantAccount; - } - public void setMerchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - } + public void setAmount(Amount amount) { + this.amount = amount; + } - public StoredValueBalanceMergeRequest paymentMethod(PaymentMethod paymentMethod) { - this.paymentMethod = paymentMethod; - return this; - } - /** - * The collection that contains the type of the payment method and its specific information if available - * - * @return paymentMethod - **/ - public PaymentMethod getPaymentMethod() { - return paymentMethod; - } + public StoredValueBalanceMergeRequest merchantAccount(String merchantAccount) { + + this.merchantAccount = merchantAccount; + return this; + } - public void setPaymentMethod(PaymentMethod paymentMethod) { - this.paymentMethod = paymentMethod; - } + /** + * The merchant account identifier, with which you want to process the transaction. + * @return merchantAccount + **/ + @ApiModelProperty(required = true, value = "The merchant account identifier, with which you want to process the transaction.") - public StoredValueBalanceMergeRequest recurringDetailReference(String recurringDetailReference) { - this.recurringDetailReference = recurringDetailReference; - return this; - } + public String getMerchantAccount() { + return merchantAccount; + } - /** - * Get recurringDetailReference - * - * @return recurringDetailReference - **/ - public String getRecurringDetailReference() { - return recurringDetailReference; - } - public void setRecurringDetailReference(String recurringDetailReference) { - this.recurringDetailReference = recurringDetailReference; - } + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } - public StoredValueBalanceMergeRequest reference(String reference) { - this.reference = reference; - return this; - } - /** - * The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - * - * @return reference - **/ - public String getReference() { - return reference; - } + public StoredValueBalanceMergeRequest paymentMethod(Map paymentMethod) { + + this.paymentMethod = paymentMethod; + return this; + } - public void setReference(String reference) { - this.reference = reference; - } + public StoredValueBalanceMergeRequest putPaymentMethodItem(String key, String paymentMethodItem) { + this.paymentMethod.put(key, paymentMethodItem); + return this; + } - public StoredValueBalanceMergeRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { - this.shopperInteraction = shopperInteraction; - return this; - } + /** + * The collection that contains the type of the payment method and its specific information if available + * @return paymentMethod + **/ + @ApiModelProperty(required = true, value = "The collection that contains the type of the payment method and its specific information if available") - /** - * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - * - * @return shopperInteraction - **/ - public ShopperInteractionEnum getShopperInteraction() { - return shopperInteraction; - } + public Map getPaymentMethod() { + return paymentMethod; + } - public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { - this.shopperInteraction = shopperInteraction; - } - public StoredValueBalanceMergeRequest shopperReference(String shopperReference) { - this.shopperReference = shopperReference; - return this; - } + public void setPaymentMethod(Map paymentMethod) { + this.paymentMethod = paymentMethod; + } - /** - * Get shopperReference - * - * @return shopperReference - **/ - public String getShopperReference() { - return shopperReference; - } - public void setShopperReference(String shopperReference) { - this.shopperReference = shopperReference; - } + public StoredValueBalanceMergeRequest recurringDetailReference(String recurringDetailReference) { + + this.recurringDetailReference = recurringDetailReference; + return this; + } - public StoredValueBalanceMergeRequest sourcePaymentMethod(PaymentMethod sourcePaymentMethod) { - this.sourcePaymentMethod = sourcePaymentMethod; - return this; - } + /** + * Get recurringDetailReference + * @return recurringDetailReference + **/ + @ApiModelProperty(value = "") - /** - * The collection that contains the source payment method and its specific information if available. Note that type should not be included since it is inferred from the (target) payment method - * - * @return sourcePaymentMethod - **/ - public PaymentMethod getSourcePaymentMethod() { - return sourcePaymentMethod; - } + public String getRecurringDetailReference() { + return recurringDetailReference; + } - public void setSourcePaymentMethod(PaymentMethod sourcePaymentMethod) { - this.sourcePaymentMethod = sourcePaymentMethod; - } - public StoredValueBalanceMergeRequest store(String store) { - this.store = store; - return this; - } + public void setRecurringDetailReference(String recurringDetailReference) { + this.recurringDetailReference = recurringDetailReference; + } - /** - * The physical store, for which this payment is processed. - * - * @return store - **/ - public String getStore() { - return store; - } - public void setStore(String store) { - this.store = store; - } + public StoredValueBalanceMergeRequest reference(String reference) { + + this.reference = reference; + return this; + } + /** + * The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + * @return reference + **/ + @ApiModelProperty(required = true, value = "The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.") - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StoredValueBalanceMergeRequest storedValueBalanceMergeRequest = (StoredValueBalanceMergeRequest) o; - return Objects.equals(this.amount, storedValueBalanceMergeRequest.amount) && - Objects.equals(this.merchantAccount, storedValueBalanceMergeRequest.merchantAccount) && - Objects.equals(this.paymentMethod, storedValueBalanceMergeRequest.paymentMethod) && - Objects.equals(this.recurringDetailReference, storedValueBalanceMergeRequest.recurringDetailReference) && - Objects.equals(this.reference, storedValueBalanceMergeRequest.reference) && - Objects.equals(this.shopperInteraction, storedValueBalanceMergeRequest.shopperInteraction) && - Objects.equals(this.shopperReference, storedValueBalanceMergeRequest.shopperReference) && - Objects.equals(this.sourcePaymentMethod, storedValueBalanceMergeRequest.sourcePaymentMethod) && - Objects.equals(this.store, storedValueBalanceMergeRequest.store); - } + public String getReference() { + return reference; + } - @Override - public int hashCode() { - return Objects.hash(amount, merchantAccount, paymentMethod, recurringDetailReference, reference, shopperInteraction, shopperReference, sourcePaymentMethod, store); - } + public void setReference(String reference) { + this.reference = reference; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StoredValueBalanceMergeRequest {\n"); - - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); - sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); - sb.append(" recurringDetailReference: ").append(toIndentedString(recurringDetailReference)).append("\n"); - sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); - sb.append(" shopperInteraction: ").append(toIndentedString(shopperInteraction)).append("\n"); - sb.append(" shopperReference: ").append(toIndentedString(shopperReference)).append("\n"); - sb.append(" sourcePaymentMethod: ").append(toIndentedString(sourcePaymentMethod)).append("\n"); - sb.append(" store: ").append(toIndentedString(store)).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"; + public StoredValueBalanceMergeRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { + + this.shopperInteraction = shopperInteraction; + return this; + } + + /** + * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + * @return shopperInteraction + **/ + @ApiModelProperty(value = "Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.") + + public ShopperInteractionEnum getShopperInteraction() { + return shopperInteraction; + } + + + public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { + this.shopperInteraction = shopperInteraction; + } + + + public StoredValueBalanceMergeRequest shopperReference(String shopperReference) { + + this.shopperReference = shopperReference; + return this; + } + + /** + * Get shopperReference + * @return shopperReference + **/ + @ApiModelProperty(value = "") + + public String getShopperReference() { + return shopperReference; + } + + + public void setShopperReference(String shopperReference) { + this.shopperReference = shopperReference; + } + + + public StoredValueBalanceMergeRequest sourcePaymentMethod(Map sourcePaymentMethod) { + + this.sourcePaymentMethod = sourcePaymentMethod; + return this; + } + + public StoredValueBalanceMergeRequest putSourcePaymentMethodItem(String key, String sourcePaymentMethodItem) { + this.sourcePaymentMethod.put(key, sourcePaymentMethodItem); + return this; + } + + /** + * The collection that contains the source payment method and its specific information if available. Note that type should not be included since it is inferred from the (target) payment method + * @return sourcePaymentMethod + **/ + @ApiModelProperty(required = true, value = "The collection that contains the source payment method and its specific information if available. Note that type should not be included since it is inferred from the (target) payment method") + + public Map getSourcePaymentMethod() { + return sourcePaymentMethod; + } + + + public void setSourcePaymentMethod(Map sourcePaymentMethod) { + this.sourcePaymentMethod = sourcePaymentMethod; + } + + + public StoredValueBalanceMergeRequest store(String store) { + + this.store = store; + return this; + } + + /** + * The physical store, for which this payment is processed. + * @return store + **/ + @ApiModelProperty(value = "The physical store, for which this payment is processed.") + + public String getStore() { + return store; + } + + + public void setStore(String store) { + this.store = store; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueBalanceMergeRequest storedValueBalanceMergeRequest = (StoredValueBalanceMergeRequest) o; + return Objects.equals(this.amount, storedValueBalanceMergeRequest.amount) && + Objects.equals(this.merchantAccount, storedValueBalanceMergeRequest.merchantAccount) && + Objects.equals(this.paymentMethod, storedValueBalanceMergeRequest.paymentMethod) && + Objects.equals(this.recurringDetailReference, storedValueBalanceMergeRequest.recurringDetailReference) && + Objects.equals(this.reference, storedValueBalanceMergeRequest.reference) && + Objects.equals(this.shopperInteraction, storedValueBalanceMergeRequest.shopperInteraction) && + Objects.equals(this.shopperReference, storedValueBalanceMergeRequest.shopperReference) && + Objects.equals(this.sourcePaymentMethod, storedValueBalanceMergeRequest.sourcePaymentMethod) && + Objects.equals(this.store, storedValueBalanceMergeRequest.store); + } + + @Override + public int hashCode() { + return Objects.hash(amount, merchantAccount, paymentMethod, recurringDetailReference, reference, shopperInteraction, shopperReference, sourcePaymentMethod, store); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueBalanceMergeRequest {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); + sb.append(" recurringDetailReference: ").append(toIndentedString(recurringDetailReference)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" shopperInteraction: ").append(toIndentedString(shopperInteraction)).append("\n"); + sb.append(" shopperReference: ").append(toIndentedString(shopperReference)).append("\n"); + sb.append(" sourcePaymentMethod: ").append(toIndentedString(sourcePaymentMethod)).append("\n"); + sb.append(" store: ").append(toIndentedString(store)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("amount"); + openapiFields.add("merchantAccount"); + openapiFields.add("paymentMethod"); + openapiFields.add("recurringDetailReference"); + openapiFields.add("reference"); + openapiFields.add("shopperInteraction"); + openapiFields.add("shopperReference"); + openapiFields.add("sourcePaymentMethod"); + openapiFields.add("store"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("merchantAccount"); + openapiRequiredFields.add("paymentMethod"); + openapiRequiredFields.add("reference"); + openapiRequiredFields.add("sourcePaymentMethod"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StoredValueBalanceMergeRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (StoredValueBalanceMergeRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in StoredValueBalanceMergeRequest is not found in the empty JSON string", StoredValueBalanceMergeRequest.openapiRequiredFields.toString())); } - return o.toString().replace("\n", "\n "); - } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StoredValueBalanceMergeRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredValueBalanceMergeRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StoredValueBalanceMergeRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + // validate the optional field merchantAccount + if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); + } + // validate the optional field recurringDetailReference + if (jsonObj.get("recurringDetailReference") != null && !jsonObj.get("recurringDetailReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringDetailReference").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + // ensure the field shopperInteraction can be parsed to an enum value + if (jsonObj.get("shopperInteraction") != null) { + if(!jsonObj.get("shopperInteraction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shopperInteraction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperInteraction").toString())); + } + ShopperInteractionEnum.fromValue(jsonObj.get("shopperInteraction").getAsString()); + } + // validate the optional field shopperReference + if (jsonObj.get("shopperReference") != null && !jsonObj.get("shopperReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperReference").toString())); + } + // validate the optional field store + if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StoredValueBalanceMergeRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StoredValueBalanceMergeRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StoredValueBalanceMergeRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StoredValueBalanceMergeRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StoredValueBalanceMergeRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StoredValueBalanceMergeRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueBalanceMergeRequest + * @throws IOException if the JSON string is invalid with respect to StoredValueBalanceMergeRequest + */ + public static StoredValueBalanceMergeRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StoredValueBalanceMergeRequest.class); + } + + /** + * Convert an instance of StoredValueBalanceMergeRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java old mode 100755 new mode 100644 index df78ec46b..e496d8933 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java @@ -1,263 +1,429 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. * - * Adyen Java API Library + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.storedvalue; import java.util.Objects; - +import java.util.Arrays; +import com.adyen.model.storedvalue.Amount; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; - +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.storedvalue.JSON; + /** * StoredValueBalanceMergeResponse */ public class StoredValueBalanceMergeResponse { - @SerializedName("authCode") - private String authCode = null; + public static final String SERIALIZED_NAME_AUTH_CODE = "authCode"; + @SerializedName(SERIALIZED_NAME_AUTH_CODE) + private String authCode; + + public static final String SERIALIZED_NAME_CURRENT_BALANCE = "currentBalance"; + @SerializedName(SERIALIZED_NAME_CURRENT_BALANCE) + private Amount currentBalance; + + public static final String SERIALIZED_NAME_PSP_REFERENCE = "pspReference"; + @SerializedName(SERIALIZED_NAME_PSP_REFERENCE) + private String pspReference; + + public static final String SERIALIZED_NAME_REFUSAL_REASON = "refusalReason"; + @SerializedName(SERIALIZED_NAME_REFUSAL_REASON) + private String refusalReason; + + /** + * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + */ + @JsonAdapter(ResultCodeEnum.Adapter.class) + public enum ResultCodeEnum { + SUCCESS("Success"), + + REFUSED("Refused"), + + ERROR("Error"), + + NOTENOUGHBALANCE("NotEnoughBalance"); + + private String value; + + ResultCodeEnum(String value) { + this.value = value; + } - @SerializedName("currentBalance") - private Amount currentBalance = null; + public String getValue() { + return value; + } - @SerializedName("pspReference") - private String pspReference = null; + @Override + public String toString() { + return String.valueOf(value); + } - @SerializedName("refusalReason") - private String refusalReason = null; + public static ResultCodeEnum fromValue(String value) { + for (ResultCodeEnum b : ResultCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - /** - * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. - */ - @JsonAdapter(ResultCodeEnum.Adapter.class) - public enum ResultCodeEnum { - SUCCESS("Success"), - REFUSED("Refused"), - ERROR("Error"), - NOTENOUGHBALANCE("NotEnoughBalance"); + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResultCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResultCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResultCodeEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_RESULT_CODE = "resultCode"; + @SerializedName(SERIALIZED_NAME_RESULT_CODE) + private ResultCodeEnum resultCode; - private final String value; + public static final String SERIALIZED_NAME_THIRD_PARTY_REFUSAL_REASON = "thirdPartyRefusalReason"; + @SerializedName(SERIALIZED_NAME_THIRD_PARTY_REFUSAL_REASON) + private String thirdPartyRefusalReason; - ResultCodeEnum(String value) { - this.value = value; - } + public StoredValueBalanceMergeResponse() { + } - public String getValue() { - return value; - } + public StoredValueBalanceMergeResponse authCode(String authCode) { + + this.authCode = authCode; + return this; + } - @Override - public String toString() { - return String.valueOf(value); - } + /** + * Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. + * @return authCode + **/ + @ApiModelProperty(value = "Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty.") - public static ResultCodeEnum fromValue(String text) { - for (ResultCodeEnum b : ResultCodeEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } + public String getAuthCode() { + return authCode; + } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResultCodeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ResultCodeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResultCodeEnum.fromValue(String.valueOf(value)); - } - } - } - @SerializedName("resultCode") - private ResultCodeEnum resultCode = null; + public void setAuthCode(String authCode) { + this.authCode = authCode; + } - @SerializedName("thirdPartyRefusalReason") - private String thirdPartyRefusalReason = null; - public StoredValueBalanceMergeResponse authCode(String authCode) { - this.authCode = authCode; - return this; - } + public StoredValueBalanceMergeResponse currentBalance(Amount currentBalance) { + + this.currentBalance = currentBalance; + return this; + } - /** - * Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - * - * @return authCode - **/ - public String getAuthCode() { - return authCode; - } + /** + * Get currentBalance + * @return currentBalance + **/ + @ApiModelProperty(value = "") - public void setAuthCode(String authCode) { - this.authCode = authCode; - } + public Amount getCurrentBalance() { + return currentBalance; + } - public StoredValueBalanceMergeResponse currentBalance(Amount currentBalance) { - this.currentBalance = currentBalance; - return this; - } - /** - * Get currentBalance - * - * @return currentBalance - **/ - public Amount getCurrentBalance() { - return currentBalance; - } + public void setCurrentBalance(Amount currentBalance) { + this.currentBalance = currentBalance; + } - public void setCurrentBalance(Amount currentBalance) { - this.currentBalance = currentBalance; - } - public StoredValueBalanceMergeResponse pspReference(String pspReference) { - this.pspReference = pspReference; - return this; - } + public StoredValueBalanceMergeResponse pspReference(String pspReference) { + + this.pspReference = pspReference; + return this; + } - /** - * Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - * - * @return pspReference - **/ - public String getPspReference() { - return pspReference; - } + /** + * Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + * @return pspReference + **/ + @ApiModelProperty(value = "Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request.") - public void setPspReference(String pspReference) { - this.pspReference = pspReference; - } + public String getPspReference() { + return pspReference; + } - public StoredValueBalanceMergeResponse refusalReason(String refusalReason) { - this.refusalReason = refusalReason; - return this; - } - /** - * If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. - * - * @return refusalReason - **/ - public String getRefusalReason() { - return refusalReason; - } + public void setPspReference(String pspReference) { + this.pspReference = pspReference; + } - public void setRefusalReason(String refusalReason) { - this.refusalReason = refusalReason; - } - public StoredValueBalanceMergeResponse resultCode(ResultCodeEnum resultCode) { - this.resultCode = resultCode; - return this; - } + public StoredValueBalanceMergeResponse refusalReason(String refusalReason) { + + this.refusalReason = refusalReason; + return this; + } - /** - * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. - * - * @return resultCode - **/ - public ResultCodeEnum getResultCode() { - return resultCode; - } + /** + * If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. + * @return refusalReason + **/ + @ApiModelProperty(value = "If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values.") - public void setResultCode(ResultCodeEnum resultCode) { - this.resultCode = resultCode; - } + public String getRefusalReason() { + return refusalReason; + } - public StoredValueBalanceMergeResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { - this.thirdPartyRefusalReason = thirdPartyRefusalReason; - return this; - } - /** - * Raw refusal reason received from the third party, where available - * - * @return thirdPartyRefusalReason - **/ - public String getThirdPartyRefusalReason() { - return thirdPartyRefusalReason; - } + public void setRefusalReason(String refusalReason) { + this.refusalReason = refusalReason; + } - public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { - this.thirdPartyRefusalReason = thirdPartyRefusalReason; - } + public StoredValueBalanceMergeResponse resultCode(ResultCodeEnum resultCode) { + + this.resultCode = resultCode; + return this; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StoredValueBalanceMergeResponse storedValueBalanceMergeResponse = (StoredValueBalanceMergeResponse) o; - return Objects.equals(this.authCode, storedValueBalanceMergeResponse.authCode) && - Objects.equals(this.currentBalance, storedValueBalanceMergeResponse.currentBalance) && - Objects.equals(this.pspReference, storedValueBalanceMergeResponse.pspReference) && - Objects.equals(this.refusalReason, storedValueBalanceMergeResponse.refusalReason) && - Objects.equals(this.resultCode, storedValueBalanceMergeResponse.resultCode) && - Objects.equals(this.thirdPartyRefusalReason, storedValueBalanceMergeResponse.thirdPartyRefusalReason); - } + /** + * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + * @return resultCode + **/ + @ApiModelProperty(value = "The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ") - @Override - public int hashCode() { - return Objects.hash(authCode, currentBalance, pspReference, refusalReason, resultCode, thirdPartyRefusalReason); - } + public ResultCodeEnum getResultCode() { + return resultCode; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StoredValueBalanceMergeResponse {\n"); - - sb.append(" authCode: ").append(toIndentedString(authCode)).append("\n"); - sb.append(" currentBalance: ").append(toIndentedString(currentBalance)).append("\n"); - sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); - sb.append(" refusalReason: ").append(toIndentedString(refusalReason)).append("\n"); - sb.append(" resultCode: ").append(toIndentedString(resultCode)).append("\n"); - sb.append(" thirdPartyRefusalReason: ").append(toIndentedString(thirdPartyRefusalReason)).append("\n"); - sb.append("}"); - return sb.toString(); + public void setResultCode(ResultCodeEnum resultCode) { + this.resultCode = resultCode; + } + + + public StoredValueBalanceMergeResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { + + this.thirdPartyRefusalReason = thirdPartyRefusalReason; + return this; + } + + /** + * Raw refusal reason received from the third party, where available + * @return thirdPartyRefusalReason + **/ + @ApiModelProperty(value = "Raw refusal reason received from the third party, where available") + + public String getThirdPartyRefusalReason() { + return thirdPartyRefusalReason; + } + + + public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { + this.thirdPartyRefusalReason = thirdPartyRefusalReason; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueBalanceMergeResponse storedValueBalanceMergeResponse = (StoredValueBalanceMergeResponse) o; + return Objects.equals(this.authCode, storedValueBalanceMergeResponse.authCode) && + Objects.equals(this.currentBalance, storedValueBalanceMergeResponse.currentBalance) && + Objects.equals(this.pspReference, storedValueBalanceMergeResponse.pspReference) && + Objects.equals(this.refusalReason, storedValueBalanceMergeResponse.refusalReason) && + Objects.equals(this.resultCode, storedValueBalanceMergeResponse.resultCode) && + Objects.equals(this.thirdPartyRefusalReason, storedValueBalanceMergeResponse.thirdPartyRefusalReason); + } + + @Override + public int hashCode() { + return Objects.hash(authCode, currentBalance, pspReference, refusalReason, resultCode, thirdPartyRefusalReason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueBalanceMergeResponse {\n"); + sb.append(" authCode: ").append(toIndentedString(authCode)).append("\n"); + sb.append(" currentBalance: ").append(toIndentedString(currentBalance)).append("\n"); + sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); + sb.append(" refusalReason: ").append(toIndentedString(refusalReason)).append("\n"); + sb.append(" resultCode: ").append(toIndentedString(resultCode)).append("\n"); + sb.append(" thirdPartyRefusalReason: ").append(toIndentedString(thirdPartyRefusalReason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("authCode"); + openapiFields.add("currentBalance"); + openapiFields.add("pspReference"); + openapiFields.add("refusalReason"); + openapiFields.add("resultCode"); + openapiFields.add("thirdPartyRefusalReason"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StoredValueBalanceMergeResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (StoredValueBalanceMergeResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in StoredValueBalanceMergeResponse is not found in the empty JSON string", StoredValueBalanceMergeResponse.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StoredValueBalanceMergeResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredValueBalanceMergeResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field authCode + if (jsonObj.get("authCode") != null && !jsonObj.get("authCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authCode").toString())); + } + // validate the optional field `currentBalance` + if (jsonObj.getAsJsonObject("currentBalance") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("currentBalance")); + } + // validate the optional field pspReference + if (jsonObj.get("pspReference") != null && !jsonObj.get("pspReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); + } + // validate the optional field refusalReason + if (jsonObj.get("refusalReason") != null && !jsonObj.get("refusalReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReason").toString())); + } + // ensure the field resultCode can be parsed to an enum value + if (jsonObj.get("resultCode") != null) { + if(!jsonObj.get("resultCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `resultCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultCode").toString())); } - return o.toString().replace("\n", "\n "); + ResultCodeEnum.fromValue(jsonObj.get("resultCode").getAsString()); + } + // validate the optional field thirdPartyRefusalReason + if (jsonObj.get("thirdPartyRefusalReason") != null && !jsonObj.get("thirdPartyRefusalReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `thirdPartyRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("thirdPartyRefusalReason").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StoredValueBalanceMergeResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StoredValueBalanceMergeResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StoredValueBalanceMergeResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StoredValueBalanceMergeResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StoredValueBalanceMergeResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); } - + } + + /** + * Create an instance of StoredValueBalanceMergeResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueBalanceMergeResponse + * @throws IOException if the JSON string is invalid with respect to StoredValueBalanceMergeResponse + */ + public static StoredValueBalanceMergeResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StoredValueBalanceMergeResponse.class); + } + + /** + * Convert an instance of StoredValueBalanceMergeResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java old mode 100755 new mode 100644 index 761663c7f..5b08ae046 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java @@ -1,311 +1,509 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. * - * Adyen Java API Library + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.storedvalue; -import java.util.Objects; -import com.adyen.model.checkout.PaymentMethod; +package com.adyen.model.storedvalue; +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.storedvalue.Amount; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; - +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.storedvalue.JSON; /** * StoredValueIssueRequest */ public class StoredValueIssueRequest { - @SerializedName("amount") - private Amount amount = null; + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; + + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT = "merchantAccount"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) + private String merchantAccount; + + public static final String SERIALIZED_NAME_PAYMENT_METHOD = "paymentMethod"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) + private Map paymentMethod = new HashMap<>(); + + public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) + private String recurringDetailReference; + + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; + + /** + * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + */ + @JsonAdapter(ShopperInteractionEnum.Adapter.class) + public enum ShopperInteractionEnum { + ECOMMERCE("Ecommerce"), + + CONTAUTH("ContAuth"), + + MOTO("Moto"), + + POS("POS"); + + private String value; + + ShopperInteractionEnum(String value) { + this.value = value; + } - @SerializedName("merchantAccount") - private String merchantAccount = null; + public String getValue() { + return value; + } - @SerializedName("paymentMethod") - private PaymentMethod paymentMethod = null; + @Override + public String toString() { + return String.valueOf(value); + } - @SerializedName("recurringDetailReference") - private String recurringDetailReference = null; + public static ShopperInteractionEnum fromValue(String value) { + for (ShopperInteractionEnum b : ShopperInteractionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - @SerializedName("reference") - private String reference = null; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ShopperInteractionEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ShopperInteractionEnum.fromValue(value); + } + } + } - /** - * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - */ - @JsonAdapter(ShopperInteractionEnum.Adapter.class) - public enum ShopperInteractionEnum { - ECOMMERCE("Ecommerce"), - CONTAUTH("ContAuth"), - MOTO("Moto"), - POS("POS"); + public static final String SERIALIZED_NAME_SHOPPER_INTERACTION = "shopperInteraction"; + @SerializedName(SERIALIZED_NAME_SHOPPER_INTERACTION) + private ShopperInteractionEnum shopperInteraction; + public static final String SERIALIZED_NAME_SHOPPER_REFERENCE = "shopperReference"; + @SerializedName(SERIALIZED_NAME_SHOPPER_REFERENCE) + private String shopperReference; - private final String value; + public static final String SERIALIZED_NAME_STORE = "store"; + @SerializedName(SERIALIZED_NAME_STORE) + private String store; - ShopperInteractionEnum(String value) { - this.value = value; - } + public StoredValueIssueRequest() { + } - public String getValue() { - return value; - } + public StoredValueIssueRequest amount(Amount amount) { + + this.amount = amount; + return this; + } - @Override - public String toString() { - return String.valueOf(value); - } + /** + * Get amount + * @return amount + **/ + @ApiModelProperty(value = "") - public static ShopperInteractionEnum fromValue(String text) { - for (ShopperInteractionEnum b : ShopperInteractionEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } + public Amount getAmount() { + return amount; + } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ShopperInteractionEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ShopperInteractionEnum.fromValue(String.valueOf(value)); - } - } - } - @SerializedName("shopperInteraction") - private ShopperInteractionEnum shopperInteraction = null; + public void setAmount(Amount amount) { + this.amount = amount; + } - @SerializedName("shopperReference") - private String shopperReference = null; - @SerializedName("store") - private String store = null; + public StoredValueIssueRequest merchantAccount(String merchantAccount) { + + this.merchantAccount = merchantAccount; + return this; + } - public StoredValueIssueRequest amount(Amount amount) { - this.amount = amount; - return this; - } + /** + * The merchant account identifier, with which you want to process the transaction. + * @return merchantAccount + **/ + @ApiModelProperty(required = true, value = "The merchant account identifier, with which you want to process the transaction.") - /** - * Get amount - * - * @return amount - **/ - public Amount getAmount() { - return amount; - } + public String getMerchantAccount() { + return merchantAccount; + } - public void setAmount(Amount amount) { - this.amount = amount; - } - public StoredValueIssueRequest merchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - return this; - } + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } - /** - * The merchant account identifier, with which you want to process the transaction. - * - * @return merchantAccount - **/ - public String getMerchantAccount() { - return merchantAccount; - } - public void setMerchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - } + public StoredValueIssueRequest paymentMethod(Map paymentMethod) { + + this.paymentMethod = paymentMethod; + return this; + } - public StoredValueIssueRequest paymentMethod(PaymentMethod paymentMethod) { - this.paymentMethod = paymentMethod; - return this; - } + public StoredValueIssueRequest putPaymentMethodItem(String key, String paymentMethodItem) { + this.paymentMethod.put(key, paymentMethodItem); + return this; + } - /** - * The collection that contains the type of the payment method and its specific information if available - * - * @return paymentMethod - **/ - public PaymentMethod getPaymentMethod() { - return paymentMethod; - } + /** + * The collection that contains the type of the payment method and its specific information if available + * @return paymentMethod + **/ + @ApiModelProperty(required = true, value = "The collection that contains the type of the payment method and its specific information if available") - public void setPaymentMethod(PaymentMethod paymentMethod) { - this.paymentMethod = paymentMethod; - } + public Map getPaymentMethod() { + return paymentMethod; + } - public StoredValueIssueRequest recurringDetailReference(String recurringDetailReference) { - this.recurringDetailReference = recurringDetailReference; - return this; - } - /** - * Get recurringDetailReference - * - * @return recurringDetailReference - **/ - public String getRecurringDetailReference() { - return recurringDetailReference; - } + public void setPaymentMethod(Map paymentMethod) { + this.paymentMethod = paymentMethod; + } - public void setRecurringDetailReference(String recurringDetailReference) { - this.recurringDetailReference = recurringDetailReference; - } - public StoredValueIssueRequest reference(String reference) { - this.reference = reference; - return this; - } + public StoredValueIssueRequest recurringDetailReference(String recurringDetailReference) { + + this.recurringDetailReference = recurringDetailReference; + return this; + } - /** - * The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - * - * @return reference - **/ - public String getReference() { - return reference; - } + /** + * Get recurringDetailReference + * @return recurringDetailReference + **/ + @ApiModelProperty(value = "") - public void setReference(String reference) { - this.reference = reference; - } + public String getRecurringDetailReference() { + return recurringDetailReference; + } - public StoredValueIssueRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { - this.shopperInteraction = shopperInteraction; - return this; - } - /** - * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - * - * @return shopperInteraction - **/ - public ShopperInteractionEnum getShopperInteraction() { - return shopperInteraction; - } + public void setRecurringDetailReference(String recurringDetailReference) { + this.recurringDetailReference = recurringDetailReference; + } - public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { - this.shopperInteraction = shopperInteraction; - } - public StoredValueIssueRequest shopperReference(String shopperReference) { - this.shopperReference = shopperReference; - return this; - } + public StoredValueIssueRequest reference(String reference) { + + this.reference = reference; + return this; + } - /** - * Get shopperReference - * - * @return shopperReference - **/ - public String getShopperReference() { - return shopperReference; - } + /** + * The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + * @return reference + **/ + @ApiModelProperty(required = true, value = "The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.") - public void setShopperReference(String shopperReference) { - this.shopperReference = shopperReference; - } + public String getReference() { + return reference; + } - public StoredValueIssueRequest store(String store) { - this.store = store; - return this; - } - /** - * The physical store, for which this payment is processed. - * - * @return store - **/ - public String getStore() { - return store; - } + public void setReference(String reference) { + this.reference = reference; + } - public void setStore(String store) { - this.store = store; - } + public StoredValueIssueRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { + + this.shopperInteraction = shopperInteraction; + return this; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StoredValueIssueRequest storedValueIssueRequest = (StoredValueIssueRequest) o; - return Objects.equals(this.amount, storedValueIssueRequest.amount) && - Objects.equals(this.merchantAccount, storedValueIssueRequest.merchantAccount) && - Objects.equals(this.paymentMethod, storedValueIssueRequest.paymentMethod) && - Objects.equals(this.recurringDetailReference, storedValueIssueRequest.recurringDetailReference) && - Objects.equals(this.reference, storedValueIssueRequest.reference) && - Objects.equals(this.shopperInteraction, storedValueIssueRequest.shopperInteraction) && - Objects.equals(this.shopperReference, storedValueIssueRequest.shopperReference) && - Objects.equals(this.store, storedValueIssueRequest.store); - } + /** + * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + * @return shopperInteraction + **/ + @ApiModelProperty(value = "Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.") - @Override - public int hashCode() { - return Objects.hash(amount, merchantAccount, paymentMethod, recurringDetailReference, reference, shopperInteraction, shopperReference, store); - } + public ShopperInteractionEnum getShopperInteraction() { + return shopperInteraction; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StoredValueIssueRequest {\n"); - - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); - sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); - sb.append(" recurringDetailReference: ").append(toIndentedString(recurringDetailReference)).append("\n"); - sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); - sb.append(" shopperInteraction: ").append(toIndentedString(shopperInteraction)).append("\n"); - sb.append(" shopperReference: ").append(toIndentedString(shopperReference)).append("\n"); - sb.append(" store: ").append(toIndentedString(store)).append("\n"); - sb.append("}"); - return sb.toString(); + public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { + this.shopperInteraction = shopperInteraction; + } + + + public StoredValueIssueRequest shopperReference(String shopperReference) { + + this.shopperReference = shopperReference; + return this; + } + + /** + * Get shopperReference + * @return shopperReference + **/ + @ApiModelProperty(value = "") + + public String getShopperReference() { + return shopperReference; + } + + + public void setShopperReference(String shopperReference) { + this.shopperReference = shopperReference; + } + + + public StoredValueIssueRequest store(String store) { + + this.store = store; + return this; + } + + /** + * The physical store, for which this payment is processed. + * @return store + **/ + @ApiModelProperty(value = "The physical store, for which this payment is processed.") + + public String getStore() { + return store; + } + + + public void setStore(String store) { + this.store = store; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueIssueRequest storedValueIssueRequest = (StoredValueIssueRequest) o; + return Objects.equals(this.amount, storedValueIssueRequest.amount) && + Objects.equals(this.merchantAccount, storedValueIssueRequest.merchantAccount) && + Objects.equals(this.paymentMethod, storedValueIssueRequest.paymentMethod) && + Objects.equals(this.recurringDetailReference, storedValueIssueRequest.recurringDetailReference) && + Objects.equals(this.reference, storedValueIssueRequest.reference) && + Objects.equals(this.shopperInteraction, storedValueIssueRequest.shopperInteraction) && + Objects.equals(this.shopperReference, storedValueIssueRequest.shopperReference) && + Objects.equals(this.store, storedValueIssueRequest.store); + } + + @Override + public int hashCode() { + return Objects.hash(amount, merchantAccount, paymentMethod, recurringDetailReference, reference, shopperInteraction, shopperReference, store); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueIssueRequest {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); + sb.append(" recurringDetailReference: ").append(toIndentedString(recurringDetailReference)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" shopperInteraction: ").append(toIndentedString(shopperInteraction)).append("\n"); + sb.append(" shopperReference: ").append(toIndentedString(shopperReference)).append("\n"); + sb.append(" store: ").append(toIndentedString(store)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("amount"); + openapiFields.add("merchantAccount"); + openapiFields.add("paymentMethod"); + openapiFields.add("recurringDetailReference"); + openapiFields.add("reference"); + openapiFields.add("shopperInteraction"); + openapiFields.add("shopperReference"); + openapiFields.add("store"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("merchantAccount"); + openapiRequiredFields.add("paymentMethod"); + openapiRequiredFields.add("reference"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StoredValueIssueRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (StoredValueIssueRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in StoredValueIssueRequest is not found in the empty JSON string", StoredValueIssueRequest.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StoredValueIssueRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredValueIssueRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - return o.toString().replace("\n", "\n "); - } + } + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StoredValueIssueRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + // validate the optional field merchantAccount + if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); + } + // validate the optional field recurringDetailReference + if (jsonObj.get("recurringDetailReference") != null && !jsonObj.get("recurringDetailReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringDetailReference").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + // ensure the field shopperInteraction can be parsed to an enum value + if (jsonObj.get("shopperInteraction") != null) { + if(!jsonObj.get("shopperInteraction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shopperInteraction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperInteraction").toString())); + } + ShopperInteractionEnum.fromValue(jsonObj.get("shopperInteraction").getAsString()); + } + // validate the optional field shopperReference + if (jsonObj.get("shopperReference") != null && !jsonObj.get("shopperReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperReference").toString())); + } + // validate the optional field store + if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StoredValueIssueRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StoredValueIssueRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StoredValueIssueRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StoredValueIssueRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StoredValueIssueRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StoredValueIssueRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueIssueRequest + * @throws IOException if the JSON string is invalid with respect to StoredValueIssueRequest + */ + public static StoredValueIssueRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StoredValueIssueRequest.class); + } + + /** + * Convert an instance of StoredValueIssueRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java old mode 100755 new mode 100644 index a9d3263fd..1e99c014a --- a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java @@ -1,296 +1,469 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. * - * Adyen Java API Library + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.storedvalue; import java.util.Objects; - +import java.util.Arrays; +import com.adyen.model.storedvalue.Amount; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; - +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.HashMap; +import java.util.List; import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.storedvalue.JSON; + /** * StoredValueIssueResponse */ public class StoredValueIssueResponse { - @SerializedName("authCode") - private String authCode = null; + public static final String SERIALIZED_NAME_AUTH_CODE = "authCode"; + @SerializedName(SERIALIZED_NAME_AUTH_CODE) + private String authCode; + + public static final String SERIALIZED_NAME_CURRENT_BALANCE = "currentBalance"; + @SerializedName(SERIALIZED_NAME_CURRENT_BALANCE) + private Amount currentBalance; + + public static final String SERIALIZED_NAME_PAYMENT_METHOD = "paymentMethod"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) + private Map paymentMethod = null; + + public static final String SERIALIZED_NAME_PSP_REFERENCE = "pspReference"; + @SerializedName(SERIALIZED_NAME_PSP_REFERENCE) + private String pspReference; + + public static final String SERIALIZED_NAME_REFUSAL_REASON = "refusalReason"; + @SerializedName(SERIALIZED_NAME_REFUSAL_REASON) + private String refusalReason; + + /** + * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + */ + @JsonAdapter(ResultCodeEnum.Adapter.class) + public enum ResultCodeEnum { + SUCCESS("Success"), + + REFUSED("Refused"), + + ERROR("Error"), + + NOTENOUGHBALANCE("NotEnoughBalance"); + + private String value; + + ResultCodeEnum(String value) { + this.value = value; + } - @SerializedName("currentBalance") - private Amount currentBalance = null; + public String getValue() { + return value; + } - @SerializedName("paymentMethod") - private Map paymentMethod = null; + @Override + public String toString() { + return String.valueOf(value); + } - @SerializedName("pspReference") - private String pspReference = null; + public static ResultCodeEnum fromValue(String value) { + for (ResultCodeEnum b : ResultCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - @SerializedName("refusalReason") - private String refusalReason = null; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResultCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResultCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResultCodeEnum.fromValue(value); + } + } + } - /** - * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. - */ - @JsonAdapter(ResultCodeEnum.Adapter.class) - public enum ResultCodeEnum { - SUCCESS("Success"), - REFUSED("Refused"), - ERROR("Error"), - NOTENOUGHBALANCE("NotEnoughBalance"); + public static final String SERIALIZED_NAME_RESULT_CODE = "resultCode"; + @SerializedName(SERIALIZED_NAME_RESULT_CODE) + private ResultCodeEnum resultCode; + public static final String SERIALIZED_NAME_THIRD_PARTY_REFUSAL_REASON = "thirdPartyRefusalReason"; + @SerializedName(SERIALIZED_NAME_THIRD_PARTY_REFUSAL_REASON) + private String thirdPartyRefusalReason; - private final String value; + public StoredValueIssueResponse() { + } - ResultCodeEnum(String value) { - this.value = value; - } + public StoredValueIssueResponse authCode(String authCode) { + + this.authCode = authCode; + return this; + } - public String getValue() { - return value; - } + /** + * Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. + * @return authCode + **/ + @ApiModelProperty(value = "Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty.") - @Override - public String toString() { - return String.valueOf(value); - } + public String getAuthCode() { + return authCode; + } - public static ResultCodeEnum fromValue(String text) { - for (ResultCodeEnum b : ResultCodeEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResultCodeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ResultCodeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResultCodeEnum.fromValue(String.valueOf(value)); - } - } - } + public void setAuthCode(String authCode) { + this.authCode = authCode; + } - @SerializedName("resultCode") - private ResultCodeEnum resultCode = null; - @SerializedName("thirdPartyRefusalReason") - private String thirdPartyRefusalReason = null; + public StoredValueIssueResponse currentBalance(Amount currentBalance) { + + this.currentBalance = currentBalance; + return this; + } - public StoredValueIssueResponse authCode(String authCode) { - this.authCode = authCode; - return this; - } + /** + * Get currentBalance + * @return currentBalance + **/ + @ApiModelProperty(value = "") - /** - * Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - * - * @return authCode - **/ - public String getAuthCode() { - return authCode; - } + public Amount getCurrentBalance() { + return currentBalance; + } - public void setAuthCode(String authCode) { - this.authCode = authCode; - } - public StoredValueIssueResponse currentBalance(Amount currentBalance) { - this.currentBalance = currentBalance; - return this; - } + public void setCurrentBalance(Amount currentBalance) { + this.currentBalance = currentBalance; + } - /** - * Get currentBalance - * - * @return currentBalance - **/ - public Amount getCurrentBalance() { - return currentBalance; - } - public void setCurrentBalance(Amount currentBalance) { - this.currentBalance = currentBalance; - } + public StoredValueIssueResponse paymentMethod(Map paymentMethod) { + + this.paymentMethod = paymentMethod; + return this; + } - public StoredValueIssueResponse paymentMethod(Map paymentMethod) { - this.paymentMethod = paymentMethod; - return this; + public StoredValueIssueResponse putPaymentMethodItem(String key, String paymentMethodItem) { + if (this.paymentMethod == null) { + this.paymentMethod = new HashMap<>(); } + this.paymentMethod.put(key, paymentMethodItem); + return this; + } - public StoredValueIssueResponse putPaymentMethodItem(String key, String paymentMethodItem) { - if (this.paymentMethod == null) { - this.paymentMethod = new HashMap(); - } - this.paymentMethod.put(key, paymentMethodItem); - return this; - } + /** + * The collection that contains the type of the payment method and its specific information if available + * @return paymentMethod + **/ + @ApiModelProperty(value = "The collection that contains the type of the payment method and its specific information if available") - /** - * The collection that contains the type of the payment method and its specific information if available - * - * @return paymentMethod - **/ - public Map getPaymentMethod() { - return paymentMethod; - } + public Map getPaymentMethod() { + return paymentMethod; + } - public void setPaymentMethod(Map paymentMethod) { - this.paymentMethod = paymentMethod; - } - public StoredValueIssueResponse pspReference(String pspReference) { - this.pspReference = pspReference; - return this; - } + public void setPaymentMethod(Map paymentMethod) { + this.paymentMethod = paymentMethod; + } - /** - * Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - * - * @return pspReference - **/ - public String getPspReference() { - return pspReference; - } - public void setPspReference(String pspReference) { - this.pspReference = pspReference; - } + public StoredValueIssueResponse pspReference(String pspReference) { + + this.pspReference = pspReference; + return this; + } - public StoredValueIssueResponse refusalReason(String refusalReason) { - this.refusalReason = refusalReason; - return this; - } + /** + * Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + * @return pspReference + **/ + @ApiModelProperty(value = "Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request.") - /** - * If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. - * - * @return refusalReason - **/ - public String getRefusalReason() { - return refusalReason; - } + public String getPspReference() { + return pspReference; + } - public void setRefusalReason(String refusalReason) { - this.refusalReason = refusalReason; - } - public StoredValueIssueResponse resultCode(ResultCodeEnum resultCode) { - this.resultCode = resultCode; - return this; - } + public void setPspReference(String pspReference) { + this.pspReference = pspReference; + } - /** - * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. - * - * @return resultCode - **/ - public ResultCodeEnum getResultCode() { - return resultCode; - } - public void setResultCode(ResultCodeEnum resultCode) { - this.resultCode = resultCode; - } + public StoredValueIssueResponse refusalReason(String refusalReason) { + + this.refusalReason = refusalReason; + return this; + } - public StoredValueIssueResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { - this.thirdPartyRefusalReason = thirdPartyRefusalReason; - return this; - } + /** + * If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. + * @return refusalReason + **/ + @ApiModelProperty(value = "If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values.") - /** - * Raw refusal reason received from the third party, where available - * - * @return thirdPartyRefusalReason - **/ - public String getThirdPartyRefusalReason() { - return thirdPartyRefusalReason; - } + public String getRefusalReason() { + return refusalReason; + } - public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { - this.thirdPartyRefusalReason = thirdPartyRefusalReason; - } + public void setRefusalReason(String refusalReason) { + this.refusalReason = refusalReason; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StoredValueIssueResponse storedValueIssueResponse = (StoredValueIssueResponse) o; - return Objects.equals(this.authCode, storedValueIssueResponse.authCode) && - Objects.equals(this.currentBalance, storedValueIssueResponse.currentBalance) && - Objects.equals(this.paymentMethod, storedValueIssueResponse.paymentMethod) && - Objects.equals(this.pspReference, storedValueIssueResponse.pspReference) && - Objects.equals(this.refusalReason, storedValueIssueResponse.refusalReason) && - Objects.equals(this.resultCode, storedValueIssueResponse.resultCode) && - Objects.equals(this.thirdPartyRefusalReason, storedValueIssueResponse.thirdPartyRefusalReason); - } - @Override - public int hashCode() { - return Objects.hash(authCode, currentBalance, paymentMethod, pspReference, refusalReason, resultCode, thirdPartyRefusalReason); - } + public StoredValueIssueResponse resultCode(ResultCodeEnum resultCode) { + + this.resultCode = resultCode; + return this; + } + /** + * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + * @return resultCode + **/ + @ApiModelProperty(value = "The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ") - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StoredValueIssueResponse {\n"); - - sb.append(" authCode: ").append(toIndentedString(authCode)).append("\n"); - sb.append(" currentBalance: ").append(toIndentedString(currentBalance)).append("\n"); - sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); - sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); - sb.append(" refusalReason: ").append(toIndentedString(refusalReason)).append("\n"); - sb.append(" resultCode: ").append(toIndentedString(resultCode)).append("\n"); - sb.append(" thirdPartyRefusalReason: ").append(toIndentedString(thirdPartyRefusalReason)).append("\n"); - sb.append("}"); - return sb.toString(); + public ResultCodeEnum getResultCode() { + return resultCode; + } + + + public void setResultCode(ResultCodeEnum resultCode) { + this.resultCode = resultCode; + } + + + public StoredValueIssueResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { + + this.thirdPartyRefusalReason = thirdPartyRefusalReason; + return this; + } + + /** + * Raw refusal reason received from the third party, where available + * @return thirdPartyRefusalReason + **/ + @ApiModelProperty(value = "Raw refusal reason received from the third party, where available") + + public String getThirdPartyRefusalReason() { + return thirdPartyRefusalReason; + } + + + public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { + this.thirdPartyRefusalReason = thirdPartyRefusalReason; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } + StoredValueIssueResponse storedValueIssueResponse = (StoredValueIssueResponse) o; + return Objects.equals(this.authCode, storedValueIssueResponse.authCode) && + Objects.equals(this.currentBalance, storedValueIssueResponse.currentBalance) && + Objects.equals(this.paymentMethod, storedValueIssueResponse.paymentMethod) && + Objects.equals(this.pspReference, storedValueIssueResponse.pspReference) && + Objects.equals(this.refusalReason, storedValueIssueResponse.refusalReason) && + Objects.equals(this.resultCode, storedValueIssueResponse.resultCode) && + Objects.equals(this.thirdPartyRefusalReason, storedValueIssueResponse.thirdPartyRefusalReason); + } + + @Override + public int hashCode() { + return Objects.hash(authCode, currentBalance, paymentMethod, pspReference, refusalReason, resultCode, thirdPartyRefusalReason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueIssueResponse {\n"); + sb.append(" authCode: ").append(toIndentedString(authCode)).append("\n"); + sb.append(" currentBalance: ").append(toIndentedString(currentBalance)).append("\n"); + sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); + sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); + sb.append(" refusalReason: ").append(toIndentedString(refusalReason)).append("\n"); + sb.append(" resultCode: ").append(toIndentedString(resultCode)).append("\n"); + sb.append(" thirdPartyRefusalReason: ").append(toIndentedString(thirdPartyRefusalReason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("authCode"); + openapiFields.add("currentBalance"); + openapiFields.add("paymentMethod"); + openapiFields.add("pspReference"); + openapiFields.add("refusalReason"); + openapiFields.add("resultCode"); + openapiFields.add("thirdPartyRefusalReason"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StoredValueIssueResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (StoredValueIssueResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in StoredValueIssueResponse is not found in the empty JSON string", StoredValueIssueResponse.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StoredValueIssueResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredValueIssueResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - return o.toString().replace("\n", "\n "); + } + // validate the optional field authCode + if (jsonObj.get("authCode") != null && !jsonObj.get("authCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authCode").toString())); + } + // validate the optional field `currentBalance` + if (jsonObj.getAsJsonObject("currentBalance") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("currentBalance")); + } + // validate the optional field pspReference + if (jsonObj.get("pspReference") != null && !jsonObj.get("pspReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); + } + // validate the optional field refusalReason + if (jsonObj.get("refusalReason") != null && !jsonObj.get("refusalReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReason").toString())); + } + // ensure the field resultCode can be parsed to an enum value + if (jsonObj.get("resultCode") != null) { + if(!jsonObj.get("resultCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `resultCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultCode").toString())); + } + ResultCodeEnum.fromValue(jsonObj.get("resultCode").getAsString()); + } + // validate the optional field thirdPartyRefusalReason + if (jsonObj.get("thirdPartyRefusalReason") != null && !jsonObj.get("thirdPartyRefusalReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `thirdPartyRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("thirdPartyRefusalReason").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StoredValueIssueResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StoredValueIssueResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StoredValueIssueResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StoredValueIssueResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StoredValueIssueResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); } - + } + + /** + * Create an instance of StoredValueIssueResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueIssueResponse + * @throws IOException if the JSON string is invalid with respect to StoredValueIssueResponse + */ + public static StoredValueIssueResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StoredValueIssueResponse.class); + } + + /** + * Convert an instance of StoredValueIssueResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java old mode 100755 new mode 100644 index 1f698f603..c6c96c958 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java @@ -1,381 +1,593 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. * - * Adyen Java API Library + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.storedvalue; -import java.util.Objects; -import com.adyen.model.checkout.PaymentMethod; +package com.adyen.model.storedvalue; +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.storedvalue.Amount; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; - +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.storedvalue.JSON; /** * StoredValueLoadRequest */ public class StoredValueLoadRequest { - @SerializedName("amount") - private Amount amount = null; + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; - /** - * The type of load you are trying to do, when absent we default to 'Load' - */ - @JsonAdapter(LoadTypeEnum.Adapter.class) - public enum LoadTypeEnum { - MERCHANDISERETURN("merchandiseReturn"), - LOAD("load"); + /** + * The type of load you are trying to do, when absent we default to 'Load' + */ + @JsonAdapter(LoadTypeEnum.Adapter.class) + public enum LoadTypeEnum { + MERCHANDISERETURN("merchandiseReturn"), + + LOAD("load"); + private String value; - private final String value; + LoadTypeEnum(String value) { + this.value = value; + } - LoadTypeEnum(String value) { - this.value = value; - } + public String getValue() { + return value; + } - public String getValue() { - return value; - } + @Override + public String toString() { + return String.valueOf(value); + } - @Override - public String toString() { - return String.valueOf(value); + public static LoadTypeEnum fromValue(String value) { + for (LoadTypeEnum b : LoadTypeEnum.values()) { + if (b.value.equals(value)) { + return b; } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public static LoadTypeEnum fromValue(String text) { - for (LoadTypeEnum b : LoadTypeEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final LoadTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final LoadTypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public LoadTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return LoadTypeEnum.fromValue(String.valueOf(value)); - } - } + @Override + public LoadTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return LoadTypeEnum.fromValue(value); + } } + } - @SerializedName("loadType") - private LoadTypeEnum loadType = null; + public static final String SERIALIZED_NAME_LOAD_TYPE = "loadType"; + @SerializedName(SERIALIZED_NAME_LOAD_TYPE) + private LoadTypeEnum loadType; - @SerializedName("merchantAccount") - private String merchantAccount = null; + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT = "merchantAccount"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) + private String merchantAccount; - @SerializedName("paymentMethod") - private PaymentMethod paymentMethod = null; + public static final String SERIALIZED_NAME_PAYMENT_METHOD = "paymentMethod"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) + private Map paymentMethod = new HashMap<>(); - @SerializedName("recurringDetailReference") - private String recurringDetailReference = null; + public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) + private String recurringDetailReference; - @SerializedName("reference") - private String reference = null; + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; - /** - * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - */ - @JsonAdapter(ShopperInteractionEnum.Adapter.class) - public enum ShopperInteractionEnum { - ECOMMERCE("Ecommerce"), - CONTAUTH("ContAuth"), - MOTO("Moto"), - POS("POS"); + /** + * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + */ + @JsonAdapter(ShopperInteractionEnum.Adapter.class) + public enum ShopperInteractionEnum { + ECOMMERCE("Ecommerce"), + + CONTAUTH("ContAuth"), + + MOTO("Moto"), + + POS("POS"); + private String value; - private final String value; + ShopperInteractionEnum(String value) { + this.value = value; + } - ShopperInteractionEnum(String value) { - this.value = value; - } + public String getValue() { + return value; + } - public String getValue() { - return value; - } + @Override + public String toString() { + return String.valueOf(value); + } - @Override - public String toString() { - return String.valueOf(value); + public static ShopperInteractionEnum fromValue(String value) { + for (ShopperInteractionEnum b : ShopperInteractionEnum.values()) { + if (b.value.equals(value)) { + return b; } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public static ShopperInteractionEnum fromValue(String text) { - for (ShopperInteractionEnum b : ShopperInteractionEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ShopperInteractionEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ShopperInteractionEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ShopperInteractionEnum.fromValue(String.valueOf(value)); - } - } + @Override + public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ShopperInteractionEnum.fromValue(value); + } } + } - @SerializedName("shopperInteraction") - private ShopperInteractionEnum shopperInteraction = null; + public static final String SERIALIZED_NAME_SHOPPER_INTERACTION = "shopperInteraction"; + @SerializedName(SERIALIZED_NAME_SHOPPER_INTERACTION) + private ShopperInteractionEnum shopperInteraction; - @SerializedName("shopperReference") - private String shopperReference = null; + public static final String SERIALIZED_NAME_SHOPPER_REFERENCE = "shopperReference"; + @SerializedName(SERIALIZED_NAME_SHOPPER_REFERENCE) + private String shopperReference; - @SerializedName("store") - private String store = null; + public static final String SERIALIZED_NAME_STORE = "store"; + @SerializedName(SERIALIZED_NAME_STORE) + private String store; - public StoredValueLoadRequest amount(Amount amount) { - this.amount = amount; - return this; - } + public StoredValueLoadRequest() { + } - /** - * Get amount - * - * @return amount - **/ - public Amount getAmount() { - return amount; - } + public StoredValueLoadRequest amount(Amount amount) { + + this.amount = amount; + return this; + } - public void setAmount(Amount amount) { - this.amount = amount; - } + /** + * Get amount + * @return amount + **/ + @ApiModelProperty(required = true, value = "") - public StoredValueLoadRequest loadType(LoadTypeEnum loadType) { - this.loadType = loadType; - return this; - } + public Amount getAmount() { + return amount; + } - /** - * The type of load you are trying to do, when absent we default to 'Load' - * - * @return loadType - **/ - public LoadTypeEnum getLoadType() { - return loadType; - } - public void setLoadType(LoadTypeEnum loadType) { - this.loadType = loadType; - } + public void setAmount(Amount amount) { + this.amount = amount; + } - public StoredValueLoadRequest merchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - return this; - } - /** - * The merchant account identifier, with which you want to process the transaction. - * - * @return merchantAccount - **/ - public String getMerchantAccount() { - return merchantAccount; - } + public StoredValueLoadRequest loadType(LoadTypeEnum loadType) { + + this.loadType = loadType; + return this; + } - public void setMerchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - } + /** + * The type of load you are trying to do, when absent we default to 'Load' + * @return loadType + **/ + @ApiModelProperty(value = "The type of load you are trying to do, when absent we default to 'Load'") - public StoredValueLoadRequest paymentMethod(PaymentMethod paymentMethod) { - this.paymentMethod = paymentMethod; - return this; - } + public LoadTypeEnum getLoadType() { + return loadType; + } - /** - * The collection that contains the type of the payment method and its specific information if available - * - * @return paymentMethod - **/ - public PaymentMethod getPaymentMethod() { - return paymentMethod; - } - public void setPaymentMethod(PaymentMethod paymentMethod) { - this.paymentMethod = paymentMethod; - } + public void setLoadType(LoadTypeEnum loadType) { + this.loadType = loadType; + } - public StoredValueLoadRequest recurringDetailReference(String recurringDetailReference) { - this.recurringDetailReference = recurringDetailReference; - return this; - } - /** - * Get recurringDetailReference - * - * @return recurringDetailReference - **/ - public String getRecurringDetailReference() { - return recurringDetailReference; - } + public StoredValueLoadRequest merchantAccount(String merchantAccount) { + + this.merchantAccount = merchantAccount; + return this; + } - public void setRecurringDetailReference(String recurringDetailReference) { - this.recurringDetailReference = recurringDetailReference; - } + /** + * The merchant account identifier, with which you want to process the transaction. + * @return merchantAccount + **/ + @ApiModelProperty(required = true, value = "The merchant account identifier, with which you want to process the transaction.") - public StoredValueLoadRequest reference(String reference) { - this.reference = reference; - return this; - } + public String getMerchantAccount() { + return merchantAccount; + } - /** - * The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - * - * @return reference - **/ - public String getReference() { - return reference; - } - public void setReference(String reference) { - this.reference = reference; - } + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } - public StoredValueLoadRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { - this.shopperInteraction = shopperInteraction; - return this; - } - /** - * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - * - * @return shopperInteraction - **/ - public ShopperInteractionEnum getShopperInteraction() { - return shopperInteraction; - } + public StoredValueLoadRequest paymentMethod(Map paymentMethod) { + + this.paymentMethod = paymentMethod; + return this; + } - public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { - this.shopperInteraction = shopperInteraction; - } + public StoredValueLoadRequest putPaymentMethodItem(String key, String paymentMethodItem) { + this.paymentMethod.put(key, paymentMethodItem); + return this; + } - public StoredValueLoadRequest shopperReference(String shopperReference) { - this.shopperReference = shopperReference; - return this; - } + /** + * The collection that contains the type of the payment method and its specific information if available + * @return paymentMethod + **/ + @ApiModelProperty(required = true, value = "The collection that contains the type of the payment method and its specific information if available") - /** - * Get shopperReference - * - * @return shopperReference - **/ - public String getShopperReference() { - return shopperReference; - } + public Map getPaymentMethod() { + return paymentMethod; + } - public void setShopperReference(String shopperReference) { - this.shopperReference = shopperReference; - } - public StoredValueLoadRequest store(String store) { - this.store = store; - return this; - } + public void setPaymentMethod(Map paymentMethod) { + this.paymentMethod = paymentMethod; + } - /** - * The physical store, for which this payment is processed. - * - * @return store - **/ - public String getStore() { - return store; - } - public void setStore(String store) { - this.store = store; - } + public StoredValueLoadRequest recurringDetailReference(String recurringDetailReference) { + + this.recurringDetailReference = recurringDetailReference; + return this; + } + /** + * Get recurringDetailReference + * @return recurringDetailReference + **/ + @ApiModelProperty(value = "") - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StoredValueLoadRequest storedValueLoadRequest = (StoredValueLoadRequest) o; - return Objects.equals(this.amount, storedValueLoadRequest.amount) && - Objects.equals(this.loadType, storedValueLoadRequest.loadType) && - Objects.equals(this.merchantAccount, storedValueLoadRequest.merchantAccount) && - Objects.equals(this.paymentMethod, storedValueLoadRequest.paymentMethod) && - Objects.equals(this.recurringDetailReference, storedValueLoadRequest.recurringDetailReference) && - Objects.equals(this.reference, storedValueLoadRequest.reference) && - Objects.equals(this.shopperInteraction, storedValueLoadRequest.shopperInteraction) && - Objects.equals(this.shopperReference, storedValueLoadRequest.shopperReference) && - Objects.equals(this.store, storedValueLoadRequest.store); - } + public String getRecurringDetailReference() { + return recurringDetailReference; + } - @Override - public int hashCode() { - return Objects.hash(amount, loadType, merchantAccount, paymentMethod, recurringDetailReference, reference, shopperInteraction, shopperReference, store); - } + public void setRecurringDetailReference(String recurringDetailReference) { + this.recurringDetailReference = recurringDetailReference; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StoredValueLoadRequest {\n"); - - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" loadType: ").append(toIndentedString(loadType)).append("\n"); - sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); - sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); - sb.append(" recurringDetailReference: ").append(toIndentedString(recurringDetailReference)).append("\n"); - sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); - sb.append(" shopperInteraction: ").append(toIndentedString(shopperInteraction)).append("\n"); - sb.append(" shopperReference: ").append(toIndentedString(shopperReference)).append("\n"); - sb.append(" store: ").append(toIndentedString(store)).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"; + public StoredValueLoadRequest reference(String reference) { + + this.reference = reference; + return this; + } + + /** + * The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + * @return reference + **/ + @ApiModelProperty(required = true, value = "The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.") + + public String getReference() { + return reference; + } + + + public void setReference(String reference) { + this.reference = reference; + } + + + public StoredValueLoadRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { + + this.shopperInteraction = shopperInteraction; + return this; + } + + /** + * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + * @return shopperInteraction + **/ + @ApiModelProperty(value = "Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.") + + public ShopperInteractionEnum getShopperInteraction() { + return shopperInteraction; + } + + + public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { + this.shopperInteraction = shopperInteraction; + } + + + public StoredValueLoadRequest shopperReference(String shopperReference) { + + this.shopperReference = shopperReference; + return this; + } + + /** + * Get shopperReference + * @return shopperReference + **/ + @ApiModelProperty(value = "") + + public String getShopperReference() { + return shopperReference; + } + + + public void setShopperReference(String shopperReference) { + this.shopperReference = shopperReference; + } + + + public StoredValueLoadRequest store(String store) { + + this.store = store; + return this; + } + + /** + * The physical store, for which this payment is processed. + * @return store + **/ + @ApiModelProperty(value = "The physical store, for which this payment is processed.") + + public String getStore() { + return store; + } + + + public void setStore(String store) { + this.store = store; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueLoadRequest storedValueLoadRequest = (StoredValueLoadRequest) o; + return Objects.equals(this.amount, storedValueLoadRequest.amount) && + Objects.equals(this.loadType, storedValueLoadRequest.loadType) && + Objects.equals(this.merchantAccount, storedValueLoadRequest.merchantAccount) && + Objects.equals(this.paymentMethod, storedValueLoadRequest.paymentMethod) && + Objects.equals(this.recurringDetailReference, storedValueLoadRequest.recurringDetailReference) && + Objects.equals(this.reference, storedValueLoadRequest.reference) && + Objects.equals(this.shopperInteraction, storedValueLoadRequest.shopperInteraction) && + Objects.equals(this.shopperReference, storedValueLoadRequest.shopperReference) && + Objects.equals(this.store, storedValueLoadRequest.store); + } + + @Override + public int hashCode() { + return Objects.hash(amount, loadType, merchantAccount, paymentMethod, recurringDetailReference, reference, shopperInteraction, shopperReference, store); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueLoadRequest {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" loadType: ").append(toIndentedString(loadType)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); + sb.append(" recurringDetailReference: ").append(toIndentedString(recurringDetailReference)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" shopperInteraction: ").append(toIndentedString(shopperInteraction)).append("\n"); + sb.append(" shopperReference: ").append(toIndentedString(shopperReference)).append("\n"); + sb.append(" store: ").append(toIndentedString(store)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("amount"); + openapiFields.add("loadType"); + openapiFields.add("merchantAccount"); + openapiFields.add("paymentMethod"); + openapiFields.add("recurringDetailReference"); + openapiFields.add("reference"); + openapiFields.add("shopperInteraction"); + openapiFields.add("shopperReference"); + openapiFields.add("store"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("amount"); + openapiRequiredFields.add("merchantAccount"); + openapiRequiredFields.add("paymentMethod"); + openapiRequiredFields.add("reference"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StoredValueLoadRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (StoredValueLoadRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in StoredValueLoadRequest is not found in the empty JSON string", StoredValueLoadRequest.openapiRequiredFields.toString())); } - return o.toString().replace("\n", "\n "); - } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StoredValueLoadRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredValueLoadRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StoredValueLoadRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + // ensure the field loadType can be parsed to an enum value + if (jsonObj.get("loadType") != null) { + if(!jsonObj.get("loadType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loadType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loadType").toString())); + } + LoadTypeEnum.fromValue(jsonObj.get("loadType").getAsString()); + } + // validate the optional field merchantAccount + if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); + } + // validate the optional field recurringDetailReference + if (jsonObj.get("recurringDetailReference") != null && !jsonObj.get("recurringDetailReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringDetailReference").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + // ensure the field shopperInteraction can be parsed to an enum value + if (jsonObj.get("shopperInteraction") != null) { + if(!jsonObj.get("shopperInteraction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shopperInteraction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperInteraction").toString())); + } + ShopperInteractionEnum.fromValue(jsonObj.get("shopperInteraction").getAsString()); + } + // validate the optional field shopperReference + if (jsonObj.get("shopperReference") != null && !jsonObj.get("shopperReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperReference").toString())); + } + // validate the optional field store + if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StoredValueLoadRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StoredValueLoadRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StoredValueLoadRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StoredValueLoadRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StoredValueLoadRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StoredValueLoadRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueLoadRequest + * @throws IOException if the JSON string is invalid with respect to StoredValueLoadRequest + */ + public static StoredValueLoadRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StoredValueLoadRequest.class); + } + + /** + * Convert an instance of StoredValueLoadRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java old mode 100755 new mode 100644 index 0d9d7e0e8..db4803806 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java @@ -1,263 +1,429 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. * - * Adyen Java API Library + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.storedvalue; import java.util.Objects; - +import java.util.Arrays; +import com.adyen.model.storedvalue.Amount; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; - +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.storedvalue.JSON; + /** * StoredValueLoadResponse */ public class StoredValueLoadResponse { - @SerializedName("authCode") - private String authCode = null; + public static final String SERIALIZED_NAME_AUTH_CODE = "authCode"; + @SerializedName(SERIALIZED_NAME_AUTH_CODE) + private String authCode; + + public static final String SERIALIZED_NAME_CURRENT_BALANCE = "currentBalance"; + @SerializedName(SERIALIZED_NAME_CURRENT_BALANCE) + private Amount currentBalance; + + public static final String SERIALIZED_NAME_PSP_REFERENCE = "pspReference"; + @SerializedName(SERIALIZED_NAME_PSP_REFERENCE) + private String pspReference; + + public static final String SERIALIZED_NAME_REFUSAL_REASON = "refusalReason"; + @SerializedName(SERIALIZED_NAME_REFUSAL_REASON) + private String refusalReason; + + /** + * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + */ + @JsonAdapter(ResultCodeEnum.Adapter.class) + public enum ResultCodeEnum { + SUCCESS("Success"), + + REFUSED("Refused"), + + ERROR("Error"), + + NOTENOUGHBALANCE("NotEnoughBalance"); + + private String value; + + ResultCodeEnum(String value) { + this.value = value; + } - @SerializedName("currentBalance") - private Amount currentBalance = null; + public String getValue() { + return value; + } - @SerializedName("pspReference") - private String pspReference = null; + @Override + public String toString() { + return String.valueOf(value); + } - @SerializedName("refusalReason") - private String refusalReason = null; + public static ResultCodeEnum fromValue(String value) { + for (ResultCodeEnum b : ResultCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - /** - * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. - */ - @JsonAdapter(ResultCodeEnum.Adapter.class) - public enum ResultCodeEnum { - SUCCESS("Success"), - REFUSED("Refused"), - ERROR("Error"), - NOTENOUGHBALANCE("NotEnoughBalance"); + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResultCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResultCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResultCodeEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_RESULT_CODE = "resultCode"; + @SerializedName(SERIALIZED_NAME_RESULT_CODE) + private ResultCodeEnum resultCode; - private final String value; + public static final String SERIALIZED_NAME_THIRD_PARTY_REFUSAL_REASON = "thirdPartyRefusalReason"; + @SerializedName(SERIALIZED_NAME_THIRD_PARTY_REFUSAL_REASON) + private String thirdPartyRefusalReason; - ResultCodeEnum(String value) { - this.value = value; - } + public StoredValueLoadResponse() { + } - public String getValue() { - return value; - } + public StoredValueLoadResponse authCode(String authCode) { + + this.authCode = authCode; + return this; + } - @Override - public String toString() { - return String.valueOf(value); - } + /** + * Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. + * @return authCode + **/ + @ApiModelProperty(value = "Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty.") - public static ResultCodeEnum fromValue(String text) { - for (ResultCodeEnum b : ResultCodeEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } + public String getAuthCode() { + return authCode; + } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResultCodeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ResultCodeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResultCodeEnum.fromValue(String.valueOf(value)); - } - } - } - @SerializedName("resultCode") - private ResultCodeEnum resultCode = null; + public void setAuthCode(String authCode) { + this.authCode = authCode; + } - @SerializedName("thirdPartyRefusalReason") - private String thirdPartyRefusalReason = null; - public StoredValueLoadResponse authCode(String authCode) { - this.authCode = authCode; - return this; - } + public StoredValueLoadResponse currentBalance(Amount currentBalance) { + + this.currentBalance = currentBalance; + return this; + } - /** - * Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - * - * @return authCode - **/ - public String getAuthCode() { - return authCode; - } + /** + * Get currentBalance + * @return currentBalance + **/ + @ApiModelProperty(value = "") - public void setAuthCode(String authCode) { - this.authCode = authCode; - } + public Amount getCurrentBalance() { + return currentBalance; + } - public StoredValueLoadResponse currentBalance(Amount currentBalance) { - this.currentBalance = currentBalance; - return this; - } - /** - * Get currentBalance - * - * @return currentBalance - **/ - public Amount getCurrentBalance() { - return currentBalance; - } + public void setCurrentBalance(Amount currentBalance) { + this.currentBalance = currentBalance; + } - public void setCurrentBalance(Amount currentBalance) { - this.currentBalance = currentBalance; - } - public StoredValueLoadResponse pspReference(String pspReference) { - this.pspReference = pspReference; - return this; - } + public StoredValueLoadResponse pspReference(String pspReference) { + + this.pspReference = pspReference; + return this; + } - /** - * Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - * - * @return pspReference - **/ - public String getPspReference() { - return pspReference; - } + /** + * Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + * @return pspReference + **/ + @ApiModelProperty(value = "Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request.") - public void setPspReference(String pspReference) { - this.pspReference = pspReference; - } + public String getPspReference() { + return pspReference; + } - public StoredValueLoadResponse refusalReason(String refusalReason) { - this.refusalReason = refusalReason; - return this; - } - /** - * If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. - * - * @return refusalReason - **/ - public String getRefusalReason() { - return refusalReason; - } + public void setPspReference(String pspReference) { + this.pspReference = pspReference; + } - public void setRefusalReason(String refusalReason) { - this.refusalReason = refusalReason; - } - public StoredValueLoadResponse resultCode(ResultCodeEnum resultCode) { - this.resultCode = resultCode; - return this; - } + public StoredValueLoadResponse refusalReason(String refusalReason) { + + this.refusalReason = refusalReason; + return this; + } - /** - * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. - * - * @return resultCode - **/ - public ResultCodeEnum getResultCode() { - return resultCode; - } + /** + * If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. + * @return refusalReason + **/ + @ApiModelProperty(value = "If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values.") - public void setResultCode(ResultCodeEnum resultCode) { - this.resultCode = resultCode; - } + public String getRefusalReason() { + return refusalReason; + } - public StoredValueLoadResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { - this.thirdPartyRefusalReason = thirdPartyRefusalReason; - return this; - } - /** - * Raw refusal reason received from the third party, where available - * - * @return thirdPartyRefusalReason - **/ - public String getThirdPartyRefusalReason() { - return thirdPartyRefusalReason; - } + public void setRefusalReason(String refusalReason) { + this.refusalReason = refusalReason; + } - public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { - this.thirdPartyRefusalReason = thirdPartyRefusalReason; - } + public StoredValueLoadResponse resultCode(ResultCodeEnum resultCode) { + + this.resultCode = resultCode; + return this; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StoredValueLoadResponse storedValueLoadResponse = (StoredValueLoadResponse) o; - return Objects.equals(this.authCode, storedValueLoadResponse.authCode) && - Objects.equals(this.currentBalance, storedValueLoadResponse.currentBalance) && - Objects.equals(this.pspReference, storedValueLoadResponse.pspReference) && - Objects.equals(this.refusalReason, storedValueLoadResponse.refusalReason) && - Objects.equals(this.resultCode, storedValueLoadResponse.resultCode) && - Objects.equals(this.thirdPartyRefusalReason, storedValueLoadResponse.thirdPartyRefusalReason); - } + /** + * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + * @return resultCode + **/ + @ApiModelProperty(value = "The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ") - @Override - public int hashCode() { - return Objects.hash(authCode, currentBalance, pspReference, refusalReason, resultCode, thirdPartyRefusalReason); - } + public ResultCodeEnum getResultCode() { + return resultCode; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StoredValueLoadResponse {\n"); - - sb.append(" authCode: ").append(toIndentedString(authCode)).append("\n"); - sb.append(" currentBalance: ").append(toIndentedString(currentBalance)).append("\n"); - sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); - sb.append(" refusalReason: ").append(toIndentedString(refusalReason)).append("\n"); - sb.append(" resultCode: ").append(toIndentedString(resultCode)).append("\n"); - sb.append(" thirdPartyRefusalReason: ").append(toIndentedString(thirdPartyRefusalReason)).append("\n"); - sb.append("}"); - return sb.toString(); + public void setResultCode(ResultCodeEnum resultCode) { + this.resultCode = resultCode; + } + + + public StoredValueLoadResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { + + this.thirdPartyRefusalReason = thirdPartyRefusalReason; + return this; + } + + /** + * Raw refusal reason received from the third party, where available + * @return thirdPartyRefusalReason + **/ + @ApiModelProperty(value = "Raw refusal reason received from the third party, where available") + + public String getThirdPartyRefusalReason() { + return thirdPartyRefusalReason; + } + + + public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { + this.thirdPartyRefusalReason = thirdPartyRefusalReason; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueLoadResponse storedValueLoadResponse = (StoredValueLoadResponse) o; + return Objects.equals(this.authCode, storedValueLoadResponse.authCode) && + Objects.equals(this.currentBalance, storedValueLoadResponse.currentBalance) && + Objects.equals(this.pspReference, storedValueLoadResponse.pspReference) && + Objects.equals(this.refusalReason, storedValueLoadResponse.refusalReason) && + Objects.equals(this.resultCode, storedValueLoadResponse.resultCode) && + Objects.equals(this.thirdPartyRefusalReason, storedValueLoadResponse.thirdPartyRefusalReason); + } + + @Override + public int hashCode() { + return Objects.hash(authCode, currentBalance, pspReference, refusalReason, resultCode, thirdPartyRefusalReason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueLoadResponse {\n"); + sb.append(" authCode: ").append(toIndentedString(authCode)).append("\n"); + sb.append(" currentBalance: ").append(toIndentedString(currentBalance)).append("\n"); + sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); + sb.append(" refusalReason: ").append(toIndentedString(refusalReason)).append("\n"); + sb.append(" resultCode: ").append(toIndentedString(resultCode)).append("\n"); + sb.append(" thirdPartyRefusalReason: ").append(toIndentedString(thirdPartyRefusalReason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("authCode"); + openapiFields.add("currentBalance"); + openapiFields.add("pspReference"); + openapiFields.add("refusalReason"); + openapiFields.add("resultCode"); + openapiFields.add("thirdPartyRefusalReason"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StoredValueLoadResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (StoredValueLoadResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in StoredValueLoadResponse is not found in the empty JSON string", StoredValueLoadResponse.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StoredValueLoadResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredValueLoadResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field authCode + if (jsonObj.get("authCode") != null && !jsonObj.get("authCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authCode").toString())); + } + // validate the optional field `currentBalance` + if (jsonObj.getAsJsonObject("currentBalance") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("currentBalance")); + } + // validate the optional field pspReference + if (jsonObj.get("pspReference") != null && !jsonObj.get("pspReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); + } + // validate the optional field refusalReason + if (jsonObj.get("refusalReason") != null && !jsonObj.get("refusalReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReason").toString())); + } + // ensure the field resultCode can be parsed to an enum value + if (jsonObj.get("resultCode") != null) { + if(!jsonObj.get("resultCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `resultCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultCode").toString())); } - return o.toString().replace("\n", "\n "); + ResultCodeEnum.fromValue(jsonObj.get("resultCode").getAsString()); + } + // validate the optional field thirdPartyRefusalReason + if (jsonObj.get("thirdPartyRefusalReason") != null && !jsonObj.get("thirdPartyRefusalReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `thirdPartyRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("thirdPartyRefusalReason").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StoredValueLoadResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StoredValueLoadResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StoredValueLoadResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StoredValueLoadResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StoredValueLoadResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); } - + } + + /** + * Create an instance of StoredValueLoadResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueLoadResponse + * @throws IOException if the JSON string is invalid with respect to StoredValueLoadResponse + */ + public static StoredValueLoadResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StoredValueLoadResponse.class); + } + + /** + * Convert an instance of StoredValueLoadResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java old mode 100755 new mode 100644 index 488216d8a..533d2082b --- a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java @@ -1,381 +1,593 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. * - * Adyen Java API Library + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.storedvalue; -import java.util.Objects; -import com.adyen.model.checkout.PaymentMethod; +package com.adyen.model.storedvalue; +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.storedvalue.Amount; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; - +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.storedvalue.JSON; /** * StoredValueStatusChangeRequest */ public class StoredValueStatusChangeRequest { - @SerializedName("amount") - private Amount amount = null; + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; - @SerializedName("merchantAccount") - private String merchantAccount = null; + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT = "merchantAccount"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) + private String merchantAccount; - @SerializedName("paymentMethod") - private PaymentMethod paymentMethod = null; + public static final String SERIALIZED_NAME_PAYMENT_METHOD = "paymentMethod"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) + private Map paymentMethod = new HashMap<>(); - @SerializedName("recurringDetailReference") - private String recurringDetailReference = null; + public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) + private String recurringDetailReference; - @SerializedName("reference") - private String reference = null; + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; - /** - * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - */ - @JsonAdapter(ShopperInteractionEnum.Adapter.class) - public enum ShopperInteractionEnum { - ECOMMERCE("Ecommerce"), - CONTAUTH("ContAuth"), - MOTO("Moto"), - POS("POS"); + /** + * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + */ + @JsonAdapter(ShopperInteractionEnum.Adapter.class) + public enum ShopperInteractionEnum { + ECOMMERCE("Ecommerce"), + + CONTAUTH("ContAuth"), + + MOTO("Moto"), + + POS("POS"); + private String value; - private final String value; + ShopperInteractionEnum(String value) { + this.value = value; + } - ShopperInteractionEnum(String value) { - this.value = value; - } + public String getValue() { + return value; + } - public String getValue() { - return value; - } + @Override + public String toString() { + return String.valueOf(value); + } - @Override - public String toString() { - return String.valueOf(value); + public static ShopperInteractionEnum fromValue(String value) { + for (ShopperInteractionEnum b : ShopperInteractionEnum.values()) { + if (b.value.equals(value)) { + return b; } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public static ShopperInteractionEnum fromValue(String text) { - for (ShopperInteractionEnum b : ShopperInteractionEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ShopperInteractionEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ShopperInteractionEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ShopperInteractionEnum.fromValue(String.valueOf(value)); - } - } + @Override + public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ShopperInteractionEnum.fromValue(value); + } } + } - @SerializedName("shopperInteraction") - private ShopperInteractionEnum shopperInteraction = null; + public static final String SERIALIZED_NAME_SHOPPER_INTERACTION = "shopperInteraction"; + @SerializedName(SERIALIZED_NAME_SHOPPER_INTERACTION) + private ShopperInteractionEnum shopperInteraction; - @SerializedName("shopperReference") - private String shopperReference = null; + public static final String SERIALIZED_NAME_SHOPPER_REFERENCE = "shopperReference"; + @SerializedName(SERIALIZED_NAME_SHOPPER_REFERENCE) + private String shopperReference; - /** - * The status you want to change to - */ - @JsonAdapter(StatusEnum.Adapter.class) - public enum StatusEnum { - ACTIVE("active"), - INACTIVE("inactive"); + /** + * The status you want to change to + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACTIVE("active"), + + INACTIVE("inactive"); + private String value; - private final String value; + StatusEnum(String value) { + this.value = value; + } - StatusEnum(String value) { - this.value = value; - } + public String getValue() { + return value; + } - public String getValue() { - return value; - } + @Override + public String toString() { + return String.valueOf(value); + } - @Override - public String toString() { - return String.valueOf(value); + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - public static StatusEnum fromValue(String text) { - for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public StatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return StatusEnum.fromValue(String.valueOf(value)); - } - } + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } } + } - @SerializedName("status") - private StatusEnum status = null; + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; - @SerializedName("store") - private String store = null; + public static final String SERIALIZED_NAME_STORE = "store"; + @SerializedName(SERIALIZED_NAME_STORE) + private String store; - public StoredValueStatusChangeRequest amount(Amount amount) { - this.amount = amount; - return this; - } + public StoredValueStatusChangeRequest() { + } - /** - * Get amount - * - * @return amount - **/ - public Amount getAmount() { - return amount; - } + public StoredValueStatusChangeRequest amount(Amount amount) { + + this.amount = amount; + return this; + } - public void setAmount(Amount amount) { - this.amount = amount; - } + /** + * Get amount + * @return amount + **/ + @ApiModelProperty(value = "") - public StoredValueStatusChangeRequest merchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - return this; - } + public Amount getAmount() { + return amount; + } - /** - * The merchant account identifier, with which you want to process the transaction. - * - * @return merchantAccount - **/ - public String getMerchantAccount() { - return merchantAccount; - } - public void setMerchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - } + public void setAmount(Amount amount) { + this.amount = amount; + } - public StoredValueStatusChangeRequest paymentMethod(PaymentMethod paymentMethod) { - this.paymentMethod = paymentMethod; - return this; - } - /** - * The collection that contains the type of the payment method and its specific information if available - * - * @return paymentMethod - **/ - public PaymentMethod getPaymentMethod() { - return paymentMethod; - } + public StoredValueStatusChangeRequest merchantAccount(String merchantAccount) { + + this.merchantAccount = merchantAccount; + return this; + } - public void setPaymentMethod(PaymentMethod paymentMethod) { - this.paymentMethod = paymentMethod; - } + /** + * The merchant account identifier, with which you want to process the transaction. + * @return merchantAccount + **/ + @ApiModelProperty(required = true, value = "The merchant account identifier, with which you want to process the transaction.") - public StoredValueStatusChangeRequest recurringDetailReference(String recurringDetailReference) { - this.recurringDetailReference = recurringDetailReference; - return this; - } + public String getMerchantAccount() { + return merchantAccount; + } - /** - * Get recurringDetailReference - * - * @return recurringDetailReference - **/ - public String getRecurringDetailReference() { - return recurringDetailReference; - } - public void setRecurringDetailReference(String recurringDetailReference) { - this.recurringDetailReference = recurringDetailReference; - } + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } - public StoredValueStatusChangeRequest reference(String reference) { - this.reference = reference; - return this; - } - /** - * The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - * - * @return reference - **/ - public String getReference() { - return reference; - } + public StoredValueStatusChangeRequest paymentMethod(Map paymentMethod) { + + this.paymentMethod = paymentMethod; + return this; + } - public void setReference(String reference) { - this.reference = reference; - } + public StoredValueStatusChangeRequest putPaymentMethodItem(String key, String paymentMethodItem) { + this.paymentMethod.put(key, paymentMethodItem); + return this; + } - public StoredValueStatusChangeRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { - this.shopperInteraction = shopperInteraction; - return this; - } + /** + * The collection that contains the type of the payment method and its specific information if available + * @return paymentMethod + **/ + @ApiModelProperty(required = true, value = "The collection that contains the type of the payment method and its specific information if available") - /** - * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. - * - * @return shopperInteraction - **/ - public ShopperInteractionEnum getShopperInteraction() { - return shopperInteraction; - } + public Map getPaymentMethod() { + return paymentMethod; + } - public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { - this.shopperInteraction = shopperInteraction; - } - public StoredValueStatusChangeRequest shopperReference(String shopperReference) { - this.shopperReference = shopperReference; - return this; - } + public void setPaymentMethod(Map paymentMethod) { + this.paymentMethod = paymentMethod; + } - /** - * Get shopperReference - * - * @return shopperReference - **/ - public String getShopperReference() { - return shopperReference; - } - public void setShopperReference(String shopperReference) { - this.shopperReference = shopperReference; - } + public StoredValueStatusChangeRequest recurringDetailReference(String recurringDetailReference) { + + this.recurringDetailReference = recurringDetailReference; + return this; + } - public StoredValueStatusChangeRequest status(StatusEnum status) { - this.status = status; - return this; - } + /** + * Get recurringDetailReference + * @return recurringDetailReference + **/ + @ApiModelProperty(value = "") - /** - * The status you want to change to - * - * @return status - **/ - public StatusEnum getStatus() { - return status; - } + public String getRecurringDetailReference() { + return recurringDetailReference; + } - public void setStatus(StatusEnum status) { - this.status = status; - } - public StoredValueStatusChangeRequest store(String store) { - this.store = store; - return this; - } + public void setRecurringDetailReference(String recurringDetailReference) { + this.recurringDetailReference = recurringDetailReference; + } - /** - * The physical store, for which this payment is processed. - * - * @return store - **/ - public String getStore() { - return store; - } - public void setStore(String store) { - this.store = store; - } + public StoredValueStatusChangeRequest reference(String reference) { + + this.reference = reference; + return this; + } + /** + * The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + * @return reference + **/ + @ApiModelProperty(required = true, value = "The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.") - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StoredValueStatusChangeRequest storedValueStatusChangeRequest = (StoredValueStatusChangeRequest) o; - return Objects.equals(this.amount, storedValueStatusChangeRequest.amount) && - Objects.equals(this.merchantAccount, storedValueStatusChangeRequest.merchantAccount) && - Objects.equals(this.paymentMethod, storedValueStatusChangeRequest.paymentMethod) && - Objects.equals(this.recurringDetailReference, storedValueStatusChangeRequest.recurringDetailReference) && - Objects.equals(this.reference, storedValueStatusChangeRequest.reference) && - Objects.equals(this.shopperInteraction, storedValueStatusChangeRequest.shopperInteraction) && - Objects.equals(this.shopperReference, storedValueStatusChangeRequest.shopperReference) && - Objects.equals(this.status, storedValueStatusChangeRequest.status) && - Objects.equals(this.store, storedValueStatusChangeRequest.store); - } + public String getReference() { + return reference; + } - @Override - public int hashCode() { - return Objects.hash(amount, merchantAccount, paymentMethod, recurringDetailReference, reference, shopperInteraction, shopperReference, status, store); - } + public void setReference(String reference) { + this.reference = reference; + } + + + public StoredValueStatusChangeRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { + + this.shopperInteraction = shopperInteraction; + return this; + } + + /** + * Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + * @return shopperInteraction + **/ + @ApiModelProperty(value = "Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.") + + public ShopperInteractionEnum getShopperInteraction() { + return shopperInteraction; + } + + + public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { + this.shopperInteraction = shopperInteraction; + } + + + public StoredValueStatusChangeRequest shopperReference(String shopperReference) { + + this.shopperReference = shopperReference; + return this; + } + + /** + * Get shopperReference + * @return shopperReference + **/ + @ApiModelProperty(value = "") + + public String getShopperReference() { + return shopperReference; + } + + + public void setShopperReference(String shopperReference) { + this.shopperReference = shopperReference; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StoredValueStatusChangeRequest {\n"); - - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); - sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); - sb.append(" recurringDetailReference: ").append(toIndentedString(recurringDetailReference)).append("\n"); - sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); - sb.append(" shopperInteraction: ").append(toIndentedString(shopperInteraction)).append("\n"); - sb.append(" shopperReference: ").append(toIndentedString(shopperReference)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" store: ").append(toIndentedString(store)).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"; + public StoredValueStatusChangeRequest status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status you want to change to + * @return status + **/ + @ApiModelProperty(required = true, value = "The status you want to change to") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public StoredValueStatusChangeRequest store(String store) { + + this.store = store; + return this; + } + + /** + * The physical store, for which this payment is processed. + * @return store + **/ + @ApiModelProperty(value = "The physical store, for which this payment is processed.") + + public String getStore() { + return store; + } + + + public void setStore(String store) { + this.store = store; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueStatusChangeRequest storedValueStatusChangeRequest = (StoredValueStatusChangeRequest) o; + return Objects.equals(this.amount, storedValueStatusChangeRequest.amount) && + Objects.equals(this.merchantAccount, storedValueStatusChangeRequest.merchantAccount) && + Objects.equals(this.paymentMethod, storedValueStatusChangeRequest.paymentMethod) && + Objects.equals(this.recurringDetailReference, storedValueStatusChangeRequest.recurringDetailReference) && + Objects.equals(this.reference, storedValueStatusChangeRequest.reference) && + Objects.equals(this.shopperInteraction, storedValueStatusChangeRequest.shopperInteraction) && + Objects.equals(this.shopperReference, storedValueStatusChangeRequest.shopperReference) && + Objects.equals(this.status, storedValueStatusChangeRequest.status) && + Objects.equals(this.store, storedValueStatusChangeRequest.store); + } + + @Override + public int hashCode() { + return Objects.hash(amount, merchantAccount, paymentMethod, recurringDetailReference, reference, shopperInteraction, shopperReference, status, store); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueStatusChangeRequest {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); + sb.append(" recurringDetailReference: ").append(toIndentedString(recurringDetailReference)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" shopperInteraction: ").append(toIndentedString(shopperInteraction)).append("\n"); + sb.append(" shopperReference: ").append(toIndentedString(shopperReference)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" store: ").append(toIndentedString(store)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("amount"); + openapiFields.add("merchantAccount"); + openapiFields.add("paymentMethod"); + openapiFields.add("recurringDetailReference"); + openapiFields.add("reference"); + openapiFields.add("shopperInteraction"); + openapiFields.add("shopperReference"); + openapiFields.add("status"); + openapiFields.add("store"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("merchantAccount"); + openapiRequiredFields.add("paymentMethod"); + openapiRequiredFields.add("reference"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StoredValueStatusChangeRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (StoredValueStatusChangeRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in StoredValueStatusChangeRequest is not found in the empty JSON string", StoredValueStatusChangeRequest.openapiRequiredFields.toString())); } - return o.toString().replace("\n", "\n "); - } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StoredValueStatusChangeRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredValueStatusChangeRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StoredValueStatusChangeRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + // validate the optional field merchantAccount + if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); + } + // validate the optional field recurringDetailReference + if (jsonObj.get("recurringDetailReference") != null && !jsonObj.get("recurringDetailReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringDetailReference").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + // ensure the field shopperInteraction can be parsed to an enum value + if (jsonObj.get("shopperInteraction") != null) { + if(!jsonObj.get("shopperInteraction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shopperInteraction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperInteraction").toString())); + } + ShopperInteractionEnum.fromValue(jsonObj.get("shopperInteraction").getAsString()); + } + // validate the optional field shopperReference + if (jsonObj.get("shopperReference") != null && !jsonObj.get("shopperReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperReference").toString())); + } + // ensure the field status can be parsed to an enum value + if (jsonObj.get("status") != null) { + if(!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + StatusEnum.fromValue(jsonObj.get("status").getAsString()); + } + // validate the optional field store + if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StoredValueStatusChangeRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StoredValueStatusChangeRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StoredValueStatusChangeRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StoredValueStatusChangeRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StoredValueStatusChangeRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StoredValueStatusChangeRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueStatusChangeRequest + * @throws IOException if the JSON string is invalid with respect to StoredValueStatusChangeRequest + */ + public static StoredValueStatusChangeRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StoredValueStatusChangeRequest.class); + } + + /** + * Convert an instance of StoredValueStatusChangeRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java old mode 100755 new mode 100644 index 4008e8aed..25be90e49 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java @@ -1,263 +1,429 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. * - * Adyen Java API Library + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.storedvalue; import java.util.Objects; - +import java.util.Arrays; +import com.adyen.model.storedvalue.Amount; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; - +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.storedvalue.JSON; + /** * StoredValueStatusChangeResponse */ public class StoredValueStatusChangeResponse { - @SerializedName("authCode") - private String authCode = null; + public static final String SERIALIZED_NAME_AUTH_CODE = "authCode"; + @SerializedName(SERIALIZED_NAME_AUTH_CODE) + private String authCode; + + public static final String SERIALIZED_NAME_CURRENT_BALANCE = "currentBalance"; + @SerializedName(SERIALIZED_NAME_CURRENT_BALANCE) + private Amount currentBalance; + + public static final String SERIALIZED_NAME_PSP_REFERENCE = "pspReference"; + @SerializedName(SERIALIZED_NAME_PSP_REFERENCE) + private String pspReference; + + public static final String SERIALIZED_NAME_REFUSAL_REASON = "refusalReason"; + @SerializedName(SERIALIZED_NAME_REFUSAL_REASON) + private String refusalReason; + + /** + * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + */ + @JsonAdapter(ResultCodeEnum.Adapter.class) + public enum ResultCodeEnum { + SUCCESS("Success"), + + REFUSED("Refused"), + + ERROR("Error"), + + NOTENOUGHBALANCE("NotEnoughBalance"); + + private String value; + + ResultCodeEnum(String value) { + this.value = value; + } - @SerializedName("currentBalance") - private Amount currentBalance = null; + public String getValue() { + return value; + } - @SerializedName("pspReference") - private String pspReference = null; + @Override + public String toString() { + return String.valueOf(value); + } - @SerializedName("refusalReason") - private String refusalReason = null; + public static ResultCodeEnum fromValue(String value) { + for (ResultCodeEnum b : ResultCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - /** - * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. - */ - @JsonAdapter(ResultCodeEnum.Adapter.class) - public enum ResultCodeEnum { - SUCCESS("Success"), - REFUSED("Refused"), - ERROR("Error"), - NOTENOUGHBALANCE("NotEnoughBalance"); + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResultCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResultCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResultCodeEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_RESULT_CODE = "resultCode"; + @SerializedName(SERIALIZED_NAME_RESULT_CODE) + private ResultCodeEnum resultCode; - private final String value; + public static final String SERIALIZED_NAME_THIRD_PARTY_REFUSAL_REASON = "thirdPartyRefusalReason"; + @SerializedName(SERIALIZED_NAME_THIRD_PARTY_REFUSAL_REASON) + private String thirdPartyRefusalReason; - ResultCodeEnum(String value) { - this.value = value; - } + public StoredValueStatusChangeResponse() { + } - public String getValue() { - return value; - } + public StoredValueStatusChangeResponse authCode(String authCode) { + + this.authCode = authCode; + return this; + } - @Override - public String toString() { - return String.valueOf(value); - } + /** + * Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. + * @return authCode + **/ + @ApiModelProperty(value = "Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty.") - public static ResultCodeEnum fromValue(String text) { - for (ResultCodeEnum b : ResultCodeEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } + public String getAuthCode() { + return authCode; + } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResultCodeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ResultCodeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResultCodeEnum.fromValue(String.valueOf(value)); - } - } - } - @SerializedName("resultCode") - private ResultCodeEnum resultCode = null; + public void setAuthCode(String authCode) { + this.authCode = authCode; + } - @SerializedName("thirdPartyRefusalReason") - private String thirdPartyRefusalReason = null; - public StoredValueStatusChangeResponse authCode(String authCode) { - this.authCode = authCode; - return this; - } + public StoredValueStatusChangeResponse currentBalance(Amount currentBalance) { + + this.currentBalance = currentBalance; + return this; + } - /** - * Authorisation code: * When the payment is authorised, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. - * - * @return authCode - **/ - public String getAuthCode() { - return authCode; - } + /** + * Get currentBalance + * @return currentBalance + **/ + @ApiModelProperty(value = "") - public void setAuthCode(String authCode) { - this.authCode = authCode; - } + public Amount getCurrentBalance() { + return currentBalance; + } - public StoredValueStatusChangeResponse currentBalance(Amount currentBalance) { - this.currentBalance = currentBalance; - return this; - } - /** - * Get currentBalance - * - * @return currentBalance - **/ - public Amount getCurrentBalance() { - return currentBalance; - } + public void setCurrentBalance(Amount currentBalance) { + this.currentBalance = currentBalance; + } - public void setCurrentBalance(Amount currentBalance) { - this.currentBalance = currentBalance; - } - public StoredValueStatusChangeResponse pspReference(String pspReference) { - this.pspReference = pspReference; - return this; - } + public StoredValueStatusChangeResponse pspReference(String pspReference) { + + this.pspReference = pspReference; + return this; + } - /** - * Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - * - * @return pspReference - **/ - public String getPspReference() { - return pspReference; - } + /** + * Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + * @return pspReference + **/ + @ApiModelProperty(value = "Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request.") - public void setPspReference(String pspReference) { - this.pspReference = pspReference; - } + public String getPspReference() { + return pspReference; + } - public StoredValueStatusChangeResponse refusalReason(String refusalReason) { - this.refusalReason = refusalReason; - return this; - } - /** - * If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. - * - * @return refusalReason - **/ - public String getRefusalReason() { - return refusalReason; - } + public void setPspReference(String pspReference) { + this.pspReference = pspReference; + } - public void setRefusalReason(String refusalReason) { - this.refusalReason = refusalReason; - } - public StoredValueStatusChangeResponse resultCode(ResultCodeEnum resultCode) { - this.resultCode = resultCode; - return this; - } + public StoredValueStatusChangeResponse refusalReason(String refusalReason) { + + this.refusalReason = refusalReason; + return this; + } - /** - * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. - * - * @return resultCode - **/ - public ResultCodeEnum getResultCode() { - return resultCode; - } + /** + * If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. + * @return refusalReason + **/ + @ApiModelProperty(value = "If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values.") - public void setResultCode(ResultCodeEnum resultCode) { - this.resultCode = resultCode; - } + public String getRefusalReason() { + return refusalReason; + } - public StoredValueStatusChangeResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { - this.thirdPartyRefusalReason = thirdPartyRefusalReason; - return this; - } - /** - * Raw refusal reason received from the third party, where available - * - * @return thirdPartyRefusalReason - **/ - public String getThirdPartyRefusalReason() { - return thirdPartyRefusalReason; - } + public void setRefusalReason(String refusalReason) { + this.refusalReason = refusalReason; + } - public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { - this.thirdPartyRefusalReason = thirdPartyRefusalReason; - } + public StoredValueStatusChangeResponse resultCode(ResultCodeEnum resultCode) { + + this.resultCode = resultCode; + return this; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StoredValueStatusChangeResponse storedValueStatusChangeResponse = (StoredValueStatusChangeResponse) o; - return Objects.equals(this.authCode, storedValueStatusChangeResponse.authCode) && - Objects.equals(this.currentBalance, storedValueStatusChangeResponse.currentBalance) && - Objects.equals(this.pspReference, storedValueStatusChangeResponse.pspReference) && - Objects.equals(this.refusalReason, storedValueStatusChangeResponse.refusalReason) && - Objects.equals(this.resultCode, storedValueStatusChangeResponse.resultCode) && - Objects.equals(this.thirdPartyRefusalReason, storedValueStatusChangeResponse.thirdPartyRefusalReason); - } + /** + * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + * @return resultCode + **/ + @ApiModelProperty(value = "The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ") - @Override - public int hashCode() { - return Objects.hash(authCode, currentBalance, pspReference, refusalReason, resultCode, thirdPartyRefusalReason); - } + public ResultCodeEnum getResultCode() { + return resultCode; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StoredValueStatusChangeResponse {\n"); - - sb.append(" authCode: ").append(toIndentedString(authCode)).append("\n"); - sb.append(" currentBalance: ").append(toIndentedString(currentBalance)).append("\n"); - sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); - sb.append(" refusalReason: ").append(toIndentedString(refusalReason)).append("\n"); - sb.append(" resultCode: ").append(toIndentedString(resultCode)).append("\n"); - sb.append(" thirdPartyRefusalReason: ").append(toIndentedString(thirdPartyRefusalReason)).append("\n"); - sb.append("}"); - return sb.toString(); + public void setResultCode(ResultCodeEnum resultCode) { + this.resultCode = resultCode; + } + + + public StoredValueStatusChangeResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { + + this.thirdPartyRefusalReason = thirdPartyRefusalReason; + return this; + } + + /** + * Raw refusal reason received from the third party, where available + * @return thirdPartyRefusalReason + **/ + @ApiModelProperty(value = "Raw refusal reason received from the third party, where available") + + public String getThirdPartyRefusalReason() { + return thirdPartyRefusalReason; + } + + + public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { + this.thirdPartyRefusalReason = thirdPartyRefusalReason; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueStatusChangeResponse storedValueStatusChangeResponse = (StoredValueStatusChangeResponse) o; + return Objects.equals(this.authCode, storedValueStatusChangeResponse.authCode) && + Objects.equals(this.currentBalance, storedValueStatusChangeResponse.currentBalance) && + Objects.equals(this.pspReference, storedValueStatusChangeResponse.pspReference) && + Objects.equals(this.refusalReason, storedValueStatusChangeResponse.refusalReason) && + Objects.equals(this.resultCode, storedValueStatusChangeResponse.resultCode) && + Objects.equals(this.thirdPartyRefusalReason, storedValueStatusChangeResponse.thirdPartyRefusalReason); + } + + @Override + public int hashCode() { + return Objects.hash(authCode, currentBalance, pspReference, refusalReason, resultCode, thirdPartyRefusalReason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueStatusChangeResponse {\n"); + sb.append(" authCode: ").append(toIndentedString(authCode)).append("\n"); + sb.append(" currentBalance: ").append(toIndentedString(currentBalance)).append("\n"); + sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); + sb.append(" refusalReason: ").append(toIndentedString(refusalReason)).append("\n"); + sb.append(" resultCode: ").append(toIndentedString(resultCode)).append("\n"); + sb.append(" thirdPartyRefusalReason: ").append(toIndentedString(thirdPartyRefusalReason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("authCode"); + openapiFields.add("currentBalance"); + openapiFields.add("pspReference"); + openapiFields.add("refusalReason"); + openapiFields.add("resultCode"); + openapiFields.add("thirdPartyRefusalReason"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StoredValueStatusChangeResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (StoredValueStatusChangeResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in StoredValueStatusChangeResponse is not found in the empty JSON string", StoredValueStatusChangeResponse.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StoredValueStatusChangeResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredValueStatusChangeResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field authCode + if (jsonObj.get("authCode") != null && !jsonObj.get("authCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authCode").toString())); + } + // validate the optional field `currentBalance` + if (jsonObj.getAsJsonObject("currentBalance") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("currentBalance")); + } + // validate the optional field pspReference + if (jsonObj.get("pspReference") != null && !jsonObj.get("pspReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); + } + // validate the optional field refusalReason + if (jsonObj.get("refusalReason") != null && !jsonObj.get("refusalReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReason").toString())); + } + // ensure the field resultCode can be parsed to an enum value + if (jsonObj.get("resultCode") != null) { + if(!jsonObj.get("resultCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `resultCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultCode").toString())); } - return o.toString().replace("\n", "\n "); + ResultCodeEnum.fromValue(jsonObj.get("resultCode").getAsString()); + } + // validate the optional field thirdPartyRefusalReason + if (jsonObj.get("thirdPartyRefusalReason") != null && !jsonObj.get("thirdPartyRefusalReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `thirdPartyRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("thirdPartyRefusalReason").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StoredValueStatusChangeResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StoredValueStatusChangeResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StoredValueStatusChangeResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StoredValueStatusChangeResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StoredValueStatusChangeResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); } - + } + + /** + * Create an instance of StoredValueStatusChangeResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueStatusChangeResponse + * @throws IOException if the JSON string is invalid with respect to StoredValueStatusChangeResponse + */ + public static StoredValueStatusChangeResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StoredValueStatusChangeResponse.class); + } + + /** + * Convert an instance of StoredValueStatusChangeResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java old mode 100755 new mode 100644 index 2583bb2ee..e4c991e66 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java @@ -1,208 +1,383 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. * - * Adyen Java API Library + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.storedvalue; import java.util.Objects; - +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.storedvalue.JSON; /** * StoredValueVoidRequest */ public class StoredValueVoidRequest { - @SerializedName("merchantAccount") - private String merchantAccount = null; + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT = "merchantAccount"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) + private String merchantAccount; - @SerializedName("originalReference") - private String originalReference = null; + public static final String SERIALIZED_NAME_ORIGINAL_REFERENCE = "originalReference"; + @SerializedName(SERIALIZED_NAME_ORIGINAL_REFERENCE) + private String originalReference; - @SerializedName("reference") - private String reference = null; + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; - @SerializedName("store") - private String store = null; + public static final String SERIALIZED_NAME_STORE = "store"; + @SerializedName(SERIALIZED_NAME_STORE) + private String store; - @SerializedName("tenderReference") - private String tenderReference = null; + public static final String SERIALIZED_NAME_TENDER_REFERENCE = "tenderReference"; + @SerializedName(SERIALIZED_NAME_TENDER_REFERENCE) + private String tenderReference; - @SerializedName("uniqueTerminalId") - private String uniqueTerminalId = null; + public static final String SERIALIZED_NAME_UNIQUE_TERMINAL_ID = "uniqueTerminalId"; + @SerializedName(SERIALIZED_NAME_UNIQUE_TERMINAL_ID) + private String uniqueTerminalId; - public StoredValueVoidRequest merchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - return this; - } + public StoredValueVoidRequest() { + } - /** - * The merchant account identifier, with which you want to process the transaction. - * - * @return merchantAccount - **/ - public String getMerchantAccount() { - return merchantAccount; - } + public StoredValueVoidRequest merchantAccount(String merchantAccount) { + + this.merchantAccount = merchantAccount; + return this; + } - public void setMerchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - } + /** + * The merchant account identifier, with which you want to process the transaction. + * @return merchantAccount + **/ + @ApiModelProperty(required = true, value = "The merchant account identifier, with which you want to process the transaction.") - public StoredValueVoidRequest originalReference(String originalReference) { - this.originalReference = originalReference; - return this; - } + public String getMerchantAccount() { + return merchantAccount; + } - /** - * The original pspReference of the payment to modify. - * - * @return originalReference - **/ - public String getOriginalReference() { - return originalReference; - } - public void setOriginalReference(String originalReference) { - this.originalReference = originalReference; - } + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } - public StoredValueVoidRequest reference(String reference) { - this.reference = reference; - return this; - } - /** - * Optionally, you can specify your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. - * - * @return reference - **/ - public String getReference() { - return reference; - } + public StoredValueVoidRequest originalReference(String originalReference) { + + this.originalReference = originalReference; + return this; + } - public void setReference(String reference) { - this.reference = reference; - } + /** + * The original pspReference of the payment to modify. + * @return originalReference + **/ + @ApiModelProperty(required = true, value = "The original pspReference of the payment to modify.") - public StoredValueVoidRequest store(String store) { - this.store = store; - return this; - } + public String getOriginalReference() { + return originalReference; + } - /** - * The physical store, for which this payment is processed. - * - * @return store - **/ - public String getStore() { - return store; - } - public void setStore(String store) { - this.store = store; - } + public void setOriginalReference(String originalReference) { + this.originalReference = originalReference; + } - public StoredValueVoidRequest tenderReference(String tenderReference) { - this.tenderReference = tenderReference; - return this; - } - /** - * Get tenderReference - * - * @return tenderReference - **/ - public String getTenderReference() { - return tenderReference; - } + public StoredValueVoidRequest reference(String reference) { + + this.reference = reference; + return this; + } - public void setTenderReference(String tenderReference) { - this.tenderReference = tenderReference; - } + /** + * Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + * @return reference + **/ + @ApiModelProperty(value = "Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters.") - public StoredValueVoidRequest uniqueTerminalId(String uniqueTerminalId) { - this.uniqueTerminalId = uniqueTerminalId; - return this; - } + public String getReference() { + return reference; + } - /** - * Get uniqueTerminalId - * - * @return uniqueTerminalId - **/ - public String getUniqueTerminalId() { - return uniqueTerminalId; - } - public void setUniqueTerminalId(String uniqueTerminalId) { - this.uniqueTerminalId = uniqueTerminalId; - } + public void setReference(String reference) { + this.reference = reference; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StoredValueVoidRequest storedValueVoidRequest = (StoredValueVoidRequest) o; - return Objects.equals(this.merchantAccount, storedValueVoidRequest.merchantAccount) && - Objects.equals(this.originalReference, storedValueVoidRequest.originalReference) && - Objects.equals(this.reference, storedValueVoidRequest.reference) && - Objects.equals(this.store, storedValueVoidRequest.store) && - Objects.equals(this.tenderReference, storedValueVoidRequest.tenderReference) && - Objects.equals(this.uniqueTerminalId, storedValueVoidRequest.uniqueTerminalId); - } + public StoredValueVoidRequest store(String store) { + + this.store = store; + return this; + } - @Override - public int hashCode() { - return Objects.hash(merchantAccount, originalReference, reference, store, tenderReference, uniqueTerminalId); - } + /** + * The physical store, for which this payment is processed. + * @return store + **/ + @ApiModelProperty(value = "The physical store, for which this payment is processed.") + public String getStore() { + return store; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StoredValueVoidRequest {\n"); - - sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); - sb.append(" originalReference: ").append(toIndentedString(originalReference)).append("\n"); - sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); - sb.append(" store: ").append(toIndentedString(store)).append("\n"); - sb.append(" tenderReference: ").append(toIndentedString(tenderReference)).append("\n"); - sb.append(" uniqueTerminalId: ").append(toIndentedString(uniqueTerminalId)).append("\n"); - sb.append("}"); - return sb.toString(); + + public void setStore(String store) { + this.store = store; + } + + + public StoredValueVoidRequest tenderReference(String tenderReference) { + + this.tenderReference = tenderReference; + return this; + } + + /** + * The reference of the tender. + * @return tenderReference + **/ + @ApiModelProperty(value = "The reference of the tender.") + + public String getTenderReference() { + return tenderReference; + } + + + public void setTenderReference(String tenderReference) { + this.tenderReference = tenderReference; + } + + + public StoredValueVoidRequest uniqueTerminalId(String uniqueTerminalId) { + + this.uniqueTerminalId = uniqueTerminalId; + return this; + } + + /** + * The unique ID of a POS terminal. + * @return uniqueTerminalId + **/ + @ApiModelProperty(value = "The unique ID of a POS terminal.") + + public String getUniqueTerminalId() { + return uniqueTerminalId; + } + + + public void setUniqueTerminalId(String uniqueTerminalId) { + this.uniqueTerminalId = uniqueTerminalId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueVoidRequest storedValueVoidRequest = (StoredValueVoidRequest) o; + return Objects.equals(this.merchantAccount, storedValueVoidRequest.merchantAccount) && + Objects.equals(this.originalReference, storedValueVoidRequest.originalReference) && + Objects.equals(this.reference, storedValueVoidRequest.reference) && + Objects.equals(this.store, storedValueVoidRequest.store) && + Objects.equals(this.tenderReference, storedValueVoidRequest.tenderReference) && + Objects.equals(this.uniqueTerminalId, storedValueVoidRequest.uniqueTerminalId); + } + + @Override + public int hashCode() { + return Objects.hash(merchantAccount, originalReference, reference, store, tenderReference, uniqueTerminalId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueVoidRequest {\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" originalReference: ").append(toIndentedString(originalReference)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" store: ").append(toIndentedString(store)).append("\n"); + sb.append(" tenderReference: ").append(toIndentedString(tenderReference)).append("\n"); + sb.append(" uniqueTerminalId: ").append(toIndentedString(uniqueTerminalId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("merchantAccount"); + openapiFields.add("originalReference"); + openapiFields.add("reference"); + openapiFields.add("store"); + openapiFields.add("tenderReference"); + openapiFields.add("uniqueTerminalId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("merchantAccount"); + openapiRequiredFields.add("originalReference"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StoredValueVoidRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (StoredValueVoidRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in StoredValueVoidRequest is not found in the empty JSON string", StoredValueVoidRequest.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StoredValueVoidRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredValueVoidRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - return o.toString().replace("\n", "\n "); - } + } + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : StoredValueVoidRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field merchantAccount + if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); + } + // validate the optional field originalReference + if (jsonObj.get("originalReference") != null && !jsonObj.get("originalReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `originalReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalReference").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + // validate the optional field store + if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); + } + // validate the optional field tenderReference + if (jsonObj.get("tenderReference") != null && !jsonObj.get("tenderReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tenderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tenderReference").toString())); + } + // validate the optional field uniqueTerminalId + if (jsonObj.get("uniqueTerminalId") != null && !jsonObj.get("uniqueTerminalId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uniqueTerminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uniqueTerminalId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StoredValueVoidRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StoredValueVoidRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StoredValueVoidRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StoredValueVoidRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StoredValueVoidRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of StoredValueVoidRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueVoidRequest + * @throws IOException if the JSON string is invalid with respect to StoredValueVoidRequest + */ + public static StoredValueVoidRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StoredValueVoidRequest.class); + } + + /** + * Convert an instance of StoredValueVoidRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java old mode 100755 new mode 100644 index 990c11429..0df602c68 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java @@ -1,240 +1,396 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. * - * Adyen Java API Library + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.storedvalue; import java.util.Objects; - +import java.util.Arrays; +import com.adyen.model.storedvalue.Amount; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; - +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.storedvalue.JSON; + /** * StoredValueVoidResponse */ public class StoredValueVoidResponse { - @SerializedName("currentBalance") - private Amount currentBalance = null; + public static final String SERIALIZED_NAME_CURRENT_BALANCE = "currentBalance"; + @SerializedName(SERIALIZED_NAME_CURRENT_BALANCE) + private Amount currentBalance; + + public static final String SERIALIZED_NAME_PSP_REFERENCE = "pspReference"; + @SerializedName(SERIALIZED_NAME_PSP_REFERENCE) + private String pspReference; + + public static final String SERIALIZED_NAME_REFUSAL_REASON = "refusalReason"; + @SerializedName(SERIALIZED_NAME_REFUSAL_REASON) + private String refusalReason; + + /** + * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + */ + @JsonAdapter(ResultCodeEnum.Adapter.class) + public enum ResultCodeEnum { + SUCCESS("Success"), + + REFUSED("Refused"), + + ERROR("Error"), + + NOTENOUGHBALANCE("NotEnoughBalance"); + + private String value; + + ResultCodeEnum(String value) { + this.value = value; + } - @SerializedName("pspReference") - private String pspReference = null; + public String getValue() { + return value; + } - @SerializedName("refusalReason") - private String refusalReason = null; + @Override + public String toString() { + return String.valueOf(value); + } - /** - * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. - */ - @JsonAdapter(ResultCodeEnum.Adapter.class) - public enum ResultCodeEnum { - SUCCESS("Success"), - REFUSED("Refused"), - ERROR("Error"), - NOTENOUGHBALANCE("NotEnoughBalance"); + public static ResultCodeEnum fromValue(String value) { + for (ResultCodeEnum b : ResultCodeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResultCodeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResultCodeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResultCodeEnum.fromValue(value); + } + } + } - private final String value; + public static final String SERIALIZED_NAME_RESULT_CODE = "resultCode"; + @SerializedName(SERIALIZED_NAME_RESULT_CODE) + private ResultCodeEnum resultCode; - ResultCodeEnum(String value) { - this.value = value; - } + public static final String SERIALIZED_NAME_THIRD_PARTY_REFUSAL_REASON = "thirdPartyRefusalReason"; + @SerializedName(SERIALIZED_NAME_THIRD_PARTY_REFUSAL_REASON) + private String thirdPartyRefusalReason; - public String getValue() { - return value; - } + public StoredValueVoidResponse() { + } - @Override - public String toString() { - return String.valueOf(value); - } + public StoredValueVoidResponse currentBalance(Amount currentBalance) { + + this.currentBalance = currentBalance; + return this; + } - public static ResultCodeEnum fromValue(String text) { - for (ResultCodeEnum b : ResultCodeEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } + /** + * Get currentBalance + * @return currentBalance + **/ + @ApiModelProperty(value = "") - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResultCodeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ResultCodeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResultCodeEnum.fromValue(String.valueOf(value)); - } - } - } + public Amount getCurrentBalance() { + return currentBalance; + } - @SerializedName("resultCode") - private ResultCodeEnum resultCode = null; - @SerializedName("thirdPartyRefusalReason") - private String thirdPartyRefusalReason = null; + public void setCurrentBalance(Amount currentBalance) { + this.currentBalance = currentBalance; + } - public StoredValueVoidResponse currentBalance(Amount currentBalance) { - this.currentBalance = currentBalance; - return this; - } - /** - * Get currentBalance - * - * @return currentBalance - **/ - public Amount getCurrentBalance() { - return currentBalance; - } + public StoredValueVoidResponse pspReference(String pspReference) { + + this.pspReference = pspReference; + return this; + } - public void setCurrentBalance(Amount currentBalance) { - this.currentBalance = currentBalance; - } + /** + * Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. + * @return pspReference + **/ + @ApiModelProperty(value = "Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request.") - public StoredValueVoidResponse pspReference(String pspReference) { - this.pspReference = pspReference; - return this; - } + public String getPspReference() { + return pspReference; + } - /** - * Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. - * - * @return pspReference - **/ - public String getPspReference() { - return pspReference; - } - public void setPspReference(String pspReference) { - this.pspReference = pspReference; - } + public void setPspReference(String pspReference) { + this.pspReference = pspReference; + } - public StoredValueVoidResponse refusalReason(String refusalReason) { - this.refusalReason = refusalReason; - return this; - } - /** - * If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. - * - * @return refusalReason - **/ - public String getRefusalReason() { - return refusalReason; - } + public StoredValueVoidResponse refusalReason(String refusalReason) { + + this.refusalReason = refusalReason; + return this; + } - public void setRefusalReason(String refusalReason) { - this.refusalReason = refusalReason; - } + /** + * If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. + * @return refusalReason + **/ + @ApiModelProperty(value = "If the transaction is refused or an error occurs, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values.") - public StoredValueVoidResponse resultCode(ResultCodeEnum resultCode) { - this.resultCode = resultCode; - return this; - } + public String getRefusalReason() { + return refusalReason; + } - /** - * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. - * - * @return resultCode - **/ - public ResultCodeEnum getResultCode() { - return resultCode; - } - public void setResultCode(ResultCodeEnum resultCode) { - this.resultCode = resultCode; - } + public void setRefusalReason(String refusalReason) { + this.refusalReason = refusalReason; + } - public StoredValueVoidResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { - this.thirdPartyRefusalReason = thirdPartyRefusalReason; - return this; - } - /** - * Raw refusal reason received from the third party, where available - * - * @return thirdPartyRefusalReason - **/ - public String getThirdPartyRefusalReason() { - return thirdPartyRefusalReason; - } + public StoredValueVoidResponse resultCode(ResultCodeEnum resultCode) { + + this.resultCode = resultCode; + return this; + } - public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { - this.thirdPartyRefusalReason = thirdPartyRefusalReason; - } + /** + * The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. + * @return resultCode + **/ + @ApiModelProperty(value = "The result of the payment. Possible values: * **Success** – The operation has been completed successfully. * **Refused** – The operation was refused. The reason is given in the `refusalReason` field. * **Error** – There was an error when the operation was processed. The reason is given in the `refusalReason` field. * **NotEnoughBalance** – The amount on the payment method is lower than the amount given in the request. Only applicable to balance checks. ") + public ResultCodeEnum getResultCode() { + return resultCode; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StoredValueVoidResponse storedValueVoidResponse = (StoredValueVoidResponse) o; - return Objects.equals(this.currentBalance, storedValueVoidResponse.currentBalance) && - Objects.equals(this.pspReference, storedValueVoidResponse.pspReference) && - Objects.equals(this.refusalReason, storedValueVoidResponse.refusalReason) && - Objects.equals(this.resultCode, storedValueVoidResponse.resultCode) && - Objects.equals(this.thirdPartyRefusalReason, storedValueVoidResponse.thirdPartyRefusalReason); - } - @Override - public int hashCode() { - return Objects.hash(currentBalance, pspReference, refusalReason, resultCode, thirdPartyRefusalReason); - } + public void setResultCode(ResultCodeEnum resultCode) { + this.resultCode = resultCode; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StoredValueVoidResponse {\n"); - - sb.append(" currentBalance: ").append(toIndentedString(currentBalance)).append("\n"); - sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); - sb.append(" refusalReason: ").append(toIndentedString(refusalReason)).append("\n"); - sb.append(" resultCode: ").append(toIndentedString(resultCode)).append("\n"); - sb.append(" thirdPartyRefusalReason: ").append(toIndentedString(thirdPartyRefusalReason)).append("\n"); - sb.append("}"); - return sb.toString(); + public StoredValueVoidResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { + + this.thirdPartyRefusalReason = thirdPartyRefusalReason; + return this; + } + + /** + * Raw refusal reason received from the third party, where available + * @return thirdPartyRefusalReason + **/ + @ApiModelProperty(value = "Raw refusal reason received from the third party, where available") + + public String getThirdPartyRefusalReason() { + return thirdPartyRefusalReason; + } + + + public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { + this.thirdPartyRefusalReason = thirdPartyRefusalReason; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + StoredValueVoidResponse storedValueVoidResponse = (StoredValueVoidResponse) o; + return Objects.equals(this.currentBalance, storedValueVoidResponse.currentBalance) && + Objects.equals(this.pspReference, storedValueVoidResponse.pspReference) && + Objects.equals(this.refusalReason, storedValueVoidResponse.refusalReason) && + Objects.equals(this.resultCode, storedValueVoidResponse.resultCode) && + Objects.equals(this.thirdPartyRefusalReason, storedValueVoidResponse.thirdPartyRefusalReason); + } + + @Override + public int hashCode() { + return Objects.hash(currentBalance, pspReference, refusalReason, resultCode, thirdPartyRefusalReason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StoredValueVoidResponse {\n"); + sb.append(" currentBalance: ").append(toIndentedString(currentBalance)).append("\n"); + sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); + sb.append(" refusalReason: ").append(toIndentedString(refusalReason)).append("\n"); + sb.append(" resultCode: ").append(toIndentedString(resultCode)).append("\n"); + sb.append(" thirdPartyRefusalReason: ").append(toIndentedString(thirdPartyRefusalReason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("currentBalance"); + openapiFields.add("pspReference"); + openapiFields.add("refusalReason"); + openapiFields.add("resultCode"); + openapiFields.add("thirdPartyRefusalReason"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to StoredValueVoidResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (StoredValueVoidResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in StoredValueVoidResponse is not found in the empty JSON string", StoredValueVoidResponse.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!StoredValueVoidResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredValueVoidResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `currentBalance` + if (jsonObj.getAsJsonObject("currentBalance") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("currentBalance")); + } + // validate the optional field pspReference + if (jsonObj.get("pspReference") != null && !jsonObj.get("pspReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); + } + // validate the optional field refusalReason + if (jsonObj.get("refusalReason") != null && !jsonObj.get("refusalReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReason").toString())); + } + // ensure the field resultCode can be parsed to an enum value + if (jsonObj.get("resultCode") != null) { + if(!jsonObj.get("resultCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `resultCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultCode").toString())); } - return o.toString().replace("\n", "\n "); + ResultCodeEnum.fromValue(jsonObj.get("resultCode").getAsString()); + } + // validate the optional field thirdPartyRefusalReason + if (jsonObj.get("thirdPartyRefusalReason") != null && !jsonObj.get("thirdPartyRefusalReason").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `thirdPartyRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("thirdPartyRefusalReason").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!StoredValueVoidResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'StoredValueVoidResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(StoredValueVoidResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, StoredValueVoidResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public StoredValueVoidResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); } - + } + + /** + * Create an instance of StoredValueVoidResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of StoredValueVoidResponse + * @throws IOException if the JSON string is invalid with respect to StoredValueVoidResponse + */ + public static StoredValueVoidResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, StoredValueVoidResponse.class); + } + + /** + * Convert an instance of StoredValueVoidResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/service/Payout.java b/src/main/java/com/adyen/service/Payout.java deleted file mode 100644 index 1ebdad8e9..000000000 --- a/src/main/java/com/adyen/service/Payout.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ - * - * Adyen Java API Library - * - * Copyright (c) 2017 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. - */ -package com.adyen.service; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.model.RequestOptions; -import com.adyen.model.payout.ModifyRequest; -import com.adyen.model.payout.ModifyResponse; -import com.adyen.model.payout.PayoutRequest; -import com.adyen.model.payout.PayoutResponse; -import com.adyen.model.payout.StoreDetailAndSubmitRequest; -import com.adyen.model.payout.StoreDetailAndSubmitResponse; -import com.adyen.model.payout.StoreDetailRequest; -import com.adyen.model.payout.StoreDetailResponse; -import com.adyen.model.payout.SubmitRequest; -import com.adyen.model.payout.SubmitResponse; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.payout.ConfirmThirdParty; -import com.adyen.service.resource.payout.DeclineThirdParty; -import com.adyen.service.resource.payout.StoreDetail; -import com.adyen.service.resource.payout.StoreDetailAndSubmitThirdParty; -import com.adyen.service.resource.payout.SubmitThirdParty; - -import java.io.IOException; - -public class Payout extends Service { - private final StoreDetailAndSubmitThirdParty storeDetailAndSubmitThirdParty; - private final ConfirmThirdParty confirmThirdParty; - private final DeclineThirdParty declineThirdParty; - private final StoreDetail storeDetail; - private final SubmitThirdParty submitThirdparty; - private final com.adyen.service.resource.payout.Payout payout; - - public Payout(Client client) { - super(client); - - storeDetailAndSubmitThirdParty = new StoreDetailAndSubmitThirdParty(this); - confirmThirdParty = new ConfirmThirdParty(this); - declineThirdParty = new DeclineThirdParty(this); - storeDetail = new StoreDetail(this); - submitThirdparty = new SubmitThirdParty(this); - payout = new com.adyen.service.resource.payout.Payout(this); - } - - /** - * Issues a storeDetailAndSubmitThirdParty API call - * - * @param request StoreDetailAndSubmitRequest - * @return StoreDetailAndSubmitResponse - * @throws IOException IOException - * @throws ApiException ApiException - */ - public StoreDetailAndSubmitResponse storeDetailAndSubmitThirdParty(StoreDetailAndSubmitRequest request) throws IOException, ApiException { - return storeDetailAndSubmitThirdParty(request, null); - } - - /** - * Issues a storeDetailAndSubmitThirdParty API call - * - * @param request StoreDetailAndSubmitRequest - * @param requestOptions RequestOptions - * @return StoreDetailAndSubmitResponse - * @throws IOException IOException - * @throws ApiException ApiException - */ - public StoreDetailAndSubmitResponse storeDetailAndSubmitThirdParty(StoreDetailAndSubmitRequest request, RequestOptions requestOptions) throws IOException, ApiException { - String jsonRequest = request.toJson(); - - String jsonResult = storeDetailAndSubmitThirdParty.request(jsonRequest, requestOptions); - - return StoreDetailAndSubmitResponse.fromJson(jsonResult); - } - - /** - * Issues a ConfirmThirdParty API call - * - * @param request ConfirmThirdPartyRequest - * @throws IOException IOException - * @throws ApiException ApiException - */ - public ModifyResponse confirmThirdParty(ModifyRequest request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - - String jsonResult = confirmThirdParty.request(jsonRequest); - - return ModifyResponse.fromJson(jsonResult); - } - - /** - * Issues a DeclineThirdParty API call - * - * @throws IOException IOException - * @throws ApiException ApiException - */ - public ModifyResponse declineThirdParty(ModifyRequest request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - - String jsonResult = declineThirdParty.request(jsonRequest); - - return ModifyResponse.fromJson(jsonResult); - } - - /** - * Issues a storeDetail API call - * - * @param request StoreDetailRequest - * @return StoreDetailResponse - * @throws IOException IOException - * @throws ApiException ApiException - */ - public StoreDetailResponse storeDetail(StoreDetailRequest request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - - String jsonResult = storeDetail.request(jsonRequest); - - return StoreDetailResponse.fromJson(jsonResult); - } - - /** - * Issues a SubmitThirdParty API call - * - * @param request SubmitRequest - * @return submitThirdparty - * @throws IOException IOException - * @throws ApiException ApiException - */ - public SubmitResponse submitThirdparty(SubmitRequest request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - - String jsonResult = submitThirdparty.request(jsonRequest); - - return SubmitResponse.fromJson(jsonResult); - } - - /** - * Issues a payout API call - * - * @param request - * @return - * @throws IOException - * @throws ApiException - */ - public PayoutResponse payout(PayoutRequest request) throws IOException, ApiException { - return payout(request, null); - } - - /** - * Issues a payout API call - * - * @param request - * @param requestOptions - * @return - * @throws IOException - * @throws ApiException - */ - public PayoutResponse payout(PayoutRequest request, RequestOptions requestOptions) throws IOException, ApiException { - String jsonRequest = request.toJson(); - - String jsonResult = payout.request(jsonRequest, requestOptions); - - return PayoutResponse.fromJson(jsonResult); - } -} diff --git a/src/main/java/com/adyen/service/StoredValue.java b/src/main/java/com/adyen/service/StoredValue.java deleted file mode 100644 index af14f4cc4..000000000 --- a/src/main/java/com/adyen/service/StoredValue.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ - * - * Adyen Java API Library - * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. - */ - -package com.adyen.service; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.model.storedvalue.StoredValueBalanceCheckRequest; -import com.adyen.model.storedvalue.StoredValueBalanceCheckResponse; -import com.adyen.model.storedvalue.StoredValueBalanceMergeRequest; -import com.adyen.model.storedvalue.StoredValueBalanceMergeResponse; -import com.adyen.model.storedvalue.StoredValueIssueRequest; -import com.adyen.model.storedvalue.StoredValueIssueResponse; -import com.adyen.model.storedvalue.StoredValueLoadRequest; -import com.adyen.model.storedvalue.StoredValueLoadResponse; -import com.adyen.model.storedvalue.StoredValueStatusChangeRequest; -import com.adyen.model.storedvalue.StoredValueStatusChangeResponse; -import com.adyen.model.storedvalue.StoredValueVoidRequest; -import com.adyen.model.storedvalue.StoredValueVoidResponse; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.storedvalue.ChangeStatus; -import com.adyen.service.resource.storedvalue.CheckBalance; -import com.adyen.service.resource.storedvalue.Issue; -import com.adyen.service.resource.storedvalue.Load; -import com.adyen.service.resource.storedvalue.MergeBalance; -import com.adyen.service.resource.storedvalue.VoidTransaction; -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - -public class StoredValue extends ApiKeyAuthenticatedService { - - private final ChangeStatus changeStatus; - private final CheckBalance checkBalance; - private final Issue issue; - private final Load load; - private final MergeBalance mergeBalance; - private final VoidTransaction voidTransaction; - - public StoredValue(Client client) { - super(client); - changeStatus = new ChangeStatus(this); - checkBalance = new CheckBalance(this); - issue = new Issue(this); - load = new Load(this); - mergeBalance = new MergeBalance(this); - voidTransaction = new VoidTransaction(this); - } - - - public StoredValueStatusChangeResponse changeStatus(StoredValueStatusChangeRequest storedValueStatusChangeRequest) throws ApiException, IOException { - String jsonRequest = GSON.toJson(storedValueStatusChangeRequest); - - String jsonResult = changeStatus.request(jsonRequest); - - StoredValueStatusChangeResponse storedValueStatusChangeResponse = GSON.fromJson(jsonResult, new TypeToken() { - }.getType()); - - return storedValueStatusChangeResponse; - } - - public StoredValueBalanceCheckResponse checkBalance(StoredValueBalanceCheckRequest storedValueBalanceCheckRequest) throws ApiException, IOException { - String jsonRequest = GSON.toJson(storedValueBalanceCheckRequest); - - String jsonResult = checkBalance.request(jsonRequest); - - StoredValueBalanceCheckResponse storedValueBalanceCheckResponse = GSON.fromJson(jsonResult, new TypeToken() { - }.getType()); - - return storedValueBalanceCheckResponse; - } - - public StoredValueIssueResponse issue(StoredValueIssueRequest storedValueIssueRequest) throws ApiException, IOException { - String jsonRequest = GSON.toJson(storedValueIssueRequest); - - String jsonResult = issue.request(jsonRequest); - - StoredValueIssueResponse storedValueIssueResponse = GSON.fromJson(jsonResult, new TypeToken() { - }.getType()); - - return storedValueIssueResponse; - } - - public StoredValueLoadResponse load(StoredValueLoadRequest storedValueLoadRequest) throws ApiException, IOException { - String jsonRequest = GSON.toJson(storedValueLoadRequest); - - String jsonResult = load.request(jsonRequest); - - StoredValueLoadResponse storedValueLoadResponse = GSON.fromJson(jsonResult, new TypeToken() { - }.getType()); - - return storedValueLoadResponse; - } - - public StoredValueBalanceMergeResponse mergeBalance(StoredValueBalanceMergeRequest storedValueBalanceMergeRequest) throws ApiException, IOException { - String jsonRequest = GSON.toJson(storedValueBalanceMergeRequest); - - String jsonResult = mergeBalance.request(jsonRequest); - - StoredValueBalanceMergeResponse storedValueBalanceMergeResponse = GSON.fromJson(jsonResult, new TypeToken() { - }.getType()); - - return storedValueBalanceMergeResponse; - } - - public StoredValueVoidResponse voidTransaction(StoredValueVoidRequest storedValueVoidRequest) throws ApiException, IOException { - String jsonRequest = GSON.toJson(storedValueVoidRequest); - - String jsonResult = voidTransaction.request(jsonRequest); - - StoredValueVoidResponse storedValueVoidResponse = GSON.fromJson(jsonResult, new TypeToken() { - }.getType()); - - return storedValueVoidResponse; - } - -} diff --git a/src/main/java/com/adyen/service/StoredValueApi.java b/src/main/java/com/adyen/service/StoredValueApi.java new file mode 100644 index 000000000..2dcb03cb6 --- /dev/null +++ b/src/main/java/com/adyen/service/StoredValueApi.java @@ -0,0 +1,208 @@ +/* + * Adyen Stored Value API + * A set of API endpoints to manage stored value products. + * + * The version of the OpenAPI document: 46 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.storedvalue.ServiceError; +import com.adyen.model.storedvalue.StoredValueBalanceCheckRequest; +import com.adyen.model.storedvalue.StoredValueBalanceCheckResponse; +import com.adyen.model.storedvalue.StoredValueBalanceMergeRequest; +import com.adyen.model.storedvalue.StoredValueBalanceMergeResponse; +import com.adyen.model.storedvalue.StoredValueIssueRequest; +import com.adyen.model.storedvalue.StoredValueIssueResponse; +import com.adyen.model.storedvalue.StoredValueLoadRequest; +import com.adyen.model.storedvalue.StoredValueLoadResponse; +import com.adyen.model.storedvalue.StoredValueStatusChangeRequest; +import com.adyen.model.storedvalue.StoredValueStatusChangeResponse; +import com.adyen.model.storedvalue.StoredValueVoidRequest; +import com.adyen.model.storedvalue.StoredValueVoidResponse; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class StoredValueApi extends Service { + private final String baseURL; + + public StoredValueApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://pal-test.adyen.com/pal/servlet/StoredValue/v46"); + } + + /** + * Changes the status of the payment method. + * + * @param storedValueStatusChangeRequest {@link StoredValueStatusChangeRequest } (required) + * @return {@link StoredValueStatusChangeResponse } + * @throws ApiException if fails to make API call + */ + public StoredValueStatusChangeResponse changeStatus(StoredValueStatusChangeRequest storedValueStatusChangeRequest) throws ApiException, IOException { + return changeStatus(storedValueStatusChangeRequest, null); + } + + /** + * Changes the status of the payment method. + * + * @param storedValueStatusChangeRequest {@link StoredValueStatusChangeRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link StoredValueStatusChangeResponse } + * @throws ApiException if fails to make API call + */ + public StoredValueStatusChangeResponse changeStatus(StoredValueStatusChangeRequest storedValueStatusChangeRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = storedValueStatusChangeRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/changeStatus", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return StoredValueStatusChangeResponse.fromJson(jsonResult); + } + + /** + * Checks the balance. + * + * @param storedValueBalanceCheckRequest {@link StoredValueBalanceCheckRequest } (required) + * @return {@link StoredValueBalanceCheckResponse } + * @throws ApiException if fails to make API call + */ + public StoredValueBalanceCheckResponse checkBalance(StoredValueBalanceCheckRequest storedValueBalanceCheckRequest) throws ApiException, IOException { + return checkBalance(storedValueBalanceCheckRequest, null); + } + + /** + * Checks the balance. + * + * @param storedValueBalanceCheckRequest {@link StoredValueBalanceCheckRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link StoredValueBalanceCheckResponse } + * @throws ApiException if fails to make API call + */ + public StoredValueBalanceCheckResponse checkBalance(StoredValueBalanceCheckRequest storedValueBalanceCheckRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = storedValueBalanceCheckRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/checkBalance", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return StoredValueBalanceCheckResponse.fromJson(jsonResult); + } + + /** + * Issues a new card. + * + * @param storedValueIssueRequest {@link StoredValueIssueRequest } (required) + * @return {@link StoredValueIssueResponse } + * @throws ApiException if fails to make API call + */ + public StoredValueIssueResponse issue(StoredValueIssueRequest storedValueIssueRequest) throws ApiException, IOException { + return issue(storedValueIssueRequest, null); + } + + /** + * Issues a new card. + * + * @param storedValueIssueRequest {@link StoredValueIssueRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link StoredValueIssueResponse } + * @throws ApiException if fails to make API call + */ + public StoredValueIssueResponse issue(StoredValueIssueRequest storedValueIssueRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = storedValueIssueRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/issue", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return StoredValueIssueResponse.fromJson(jsonResult); + } + + /** + * Loads the payment method. + * + * @param storedValueLoadRequest {@link StoredValueLoadRequest } (required) + * @return {@link StoredValueLoadResponse } + * @throws ApiException if fails to make API call + */ + public StoredValueLoadResponse load(StoredValueLoadRequest storedValueLoadRequest) throws ApiException, IOException { + return load(storedValueLoadRequest, null); + } + + /** + * Loads the payment method. + * + * @param storedValueLoadRequest {@link StoredValueLoadRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link StoredValueLoadResponse } + * @throws ApiException if fails to make API call + */ + public StoredValueLoadResponse load(StoredValueLoadRequest storedValueLoadRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = storedValueLoadRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/load", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return StoredValueLoadResponse.fromJson(jsonResult); + } + + /** + * Merge the balance of two cards. + * + * @param storedValueBalanceMergeRequest {@link StoredValueBalanceMergeRequest } (required) + * @return {@link StoredValueBalanceMergeResponse } + * @throws ApiException if fails to make API call + */ + public StoredValueBalanceMergeResponse mergeBalance(StoredValueBalanceMergeRequest storedValueBalanceMergeRequest) throws ApiException, IOException { + return mergeBalance(storedValueBalanceMergeRequest, null); + } + + /** + * Merge the balance of two cards. + * + * @param storedValueBalanceMergeRequest {@link StoredValueBalanceMergeRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link StoredValueBalanceMergeResponse } + * @throws ApiException if fails to make API call + */ + public StoredValueBalanceMergeResponse mergeBalance(StoredValueBalanceMergeRequest storedValueBalanceMergeRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = storedValueBalanceMergeRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/mergeBalance", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return StoredValueBalanceMergeResponse.fromJson(jsonResult); + } + + /** + * Voids a transaction. + * + * @param storedValueVoidRequest {@link StoredValueVoidRequest } (required) + * @return {@link StoredValueVoidResponse } + * @throws ApiException if fails to make API call + */ + public StoredValueVoidResponse voidTransaction(StoredValueVoidRequest storedValueVoidRequest) throws ApiException, IOException { + return voidTransaction(storedValueVoidRequest, null); + } + + /** + * Voids a transaction. + * + * @param storedValueVoidRequest {@link StoredValueVoidRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link StoredValueVoidResponse } + * @throws ApiException if fails to make API call + */ + public StoredValueVoidResponse voidTransaction(StoredValueVoidRequest storedValueVoidRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = storedValueVoidRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/voidTransaction", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return StoredValueVoidResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/payout/InitializationApi.java b/src/main/java/com/adyen/service/payout/InitializationApi.java new file mode 100644 index 000000000..8c035a728 --- /dev/null +++ b/src/main/java/com/adyen/service/payout/InitializationApi.java @@ -0,0 +1,120 @@ +/* + * Adyen Payout API + * + * The version of the OpenAPI document: 68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.payout; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.payout.ServiceError; +import com.adyen.model.payout.StoreDetailAndSubmitRequest; +import com.adyen.model.payout.StoreDetailAndSubmitResponse; +import com.adyen.model.payout.StoreDetailRequest; +import com.adyen.model.payout.StoreDetailResponse; +import com.adyen.model.payout.SubmitRequest; +import com.adyen.model.payout.SubmitResponse; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class InitializationApi extends Service { + private final String baseURL; + + public InitializationApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://pal-test.adyen.com/pal/servlet/Payout/v68"); + } + + /** + * Store payout details + * + * @param storeDetailRequest {@link StoreDetailRequest } (required) + * @return {@link StoreDetailResponse } + * @throws ApiException if fails to make API call + */ + public StoreDetailResponse storeDetail(StoreDetailRequest storeDetailRequest) throws ApiException, IOException { + return storeDetail(storeDetailRequest, null); + } + + /** + * Store payout details + * + * @param storeDetailRequest {@link StoreDetailRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link StoreDetailResponse } + * @throws ApiException if fails to make API call + */ + public StoreDetailResponse storeDetail(StoreDetailRequest storeDetailRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = storeDetailRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/storeDetail", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return StoreDetailResponse.fromJson(jsonResult); + } + + /** + * Store details and submit a payout + * + * @param storeDetailAndSubmitRequest {@link StoreDetailAndSubmitRequest } (required) + * @return {@link StoreDetailAndSubmitResponse } + * @throws ApiException if fails to make API call + */ + public StoreDetailAndSubmitResponse storeDetailAndSubmitThirdParty(StoreDetailAndSubmitRequest storeDetailAndSubmitRequest) throws ApiException, IOException { + return storeDetailAndSubmitThirdParty(storeDetailAndSubmitRequest, null); + } + + /** + * Store details and submit a payout + * + * @param storeDetailAndSubmitRequest {@link StoreDetailAndSubmitRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link StoreDetailAndSubmitResponse } + * @throws ApiException if fails to make API call + */ + public StoreDetailAndSubmitResponse storeDetailAndSubmitThirdParty(StoreDetailAndSubmitRequest storeDetailAndSubmitRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = storeDetailAndSubmitRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/storeDetailAndSubmitThirdParty", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return StoreDetailAndSubmitResponse.fromJson(jsonResult); + } + + /** + * Submit a payout + * + * @param submitRequest {@link SubmitRequest } (required) + * @return {@link SubmitResponse } + * @throws ApiException if fails to make API call + */ + public SubmitResponse submitThirdParty(SubmitRequest submitRequest) throws ApiException, IOException { + return submitThirdParty(submitRequest, null); + } + + /** + * Submit a payout + * + * @param submitRequest {@link SubmitRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link SubmitResponse } + * @throws ApiException if fails to make API call + */ + public SubmitResponse submitThirdParty(SubmitRequest submitRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = submitRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/submitThirdParty", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return SubmitResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/payout/InstantPayoutsApi.java b/src/main/java/com/adyen/service/payout/InstantPayoutsApi.java new file mode 100644 index 000000000..2969ad1e9 --- /dev/null +++ b/src/main/java/com/adyen/service/payout/InstantPayoutsApi.java @@ -0,0 +1,62 @@ +/* + * Adyen Payout API + * + * The version of the OpenAPI document: 68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.payout; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.payout.PayoutRequest; +import com.adyen.model.payout.PayoutResponse; +import com.adyen.model.payout.ServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class InstantPayoutsApi extends Service { + private final String baseURL; + + public InstantPayoutsApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://pal-test.adyen.com/pal/servlet/Payout/v68"); + } + + /** + * Make an instant card payout + * + * @param payoutRequest {@link PayoutRequest } (required) + * @return {@link PayoutResponse } + * @throws ApiException if fails to make API call + */ + public PayoutResponse payout(PayoutRequest payoutRequest) throws ApiException, IOException { + return payout(payoutRequest, null); + } + + /** + * Make an instant card payout + * + * @param payoutRequest {@link PayoutRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PayoutResponse } + * @throws ApiException if fails to make API call + */ + public PayoutResponse payout(PayoutRequest payoutRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = payoutRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/payout", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return PayoutResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/payout/ReviewingApi.java b/src/main/java/com/adyen/service/payout/ReviewingApi.java new file mode 100644 index 000000000..b76059a37 --- /dev/null +++ b/src/main/java/com/adyen/service/payout/ReviewingApi.java @@ -0,0 +1,89 @@ +/* + * Adyen Payout API + * + * The version of the OpenAPI document: 68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.payout; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.payout.ModifyRequest; +import com.adyen.model.payout.ModifyResponse; +import com.adyen.model.payout.ServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class ReviewingApi extends Service { + private final String baseURL; + + public ReviewingApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://pal-test.adyen.com/pal/servlet/Payout/v68"); + } + + /** + * Confirm a payout + * + * @param modifyRequest {@link ModifyRequest } (required) + * @return {@link ModifyResponse } + * @throws ApiException if fails to make API call + */ + public ModifyResponse confirmThirdParty(ModifyRequest modifyRequest) throws ApiException, IOException { + return confirmThirdParty(modifyRequest, null); + } + + /** + * Confirm a payout + * + * @param modifyRequest {@link ModifyRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ModifyResponse } + * @throws ApiException if fails to make API call + */ + public ModifyResponse confirmThirdParty(ModifyRequest modifyRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = modifyRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/confirmThirdParty", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return ModifyResponse.fromJson(jsonResult); + } + + /** + * Cancel a payout + * + * @param modifyRequest {@link ModifyRequest } (required) + * @return {@link ModifyResponse } + * @throws ApiException if fails to make API call + */ + public ModifyResponse declineThirdParty(ModifyRequest modifyRequest) throws ApiException, IOException { + return declineThirdParty(modifyRequest, null); + } + + /** + * Cancel a payout + * + * @param modifyRequest {@link ModifyRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ModifyResponse } + * @throws ApiException if fails to make API call + */ + public ModifyResponse declineThirdParty(ModifyRequest modifyRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = modifyRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/declineThirdParty", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return ModifyResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/transfers/TransactionsApi.java b/src/main/java/com/adyen/service/transfers/TransactionsApi.java new file mode 100644 index 000000000..5e998b846 --- /dev/null +++ b/src/main/java/com/adyen/service/transfers/TransactionsApi.java @@ -0,0 +1,130 @@ +/* + * Transfers API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.transfers; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import java.time.OffsetDateTime; +import com.adyen.model.transfers.RestServiceError; +import com.adyen.model.transfers.Transaction; +import com.adyen.model.transfers.TransactionSearchResponse; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class TransactionsApi extends Service { + private final String baseURL; + + public TransactionsApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/btl/v3"); + } + + /** + * Get all transactions + * + * @param createdSince {@link OffsetDateTime } Only include transactions that have been created on or after this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**. (required) + * @param createdUntil {@link OffsetDateTime } Only include transactions that have been created on or before this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**. (required) + * @return {@link TransactionSearchResponse } + * @throws ApiException if fails to make API call + */ + public TransactionSearchResponse getAllTransactions(OffsetDateTime createdSince, OffsetDateTime createdUntil) throws ApiException, IOException { + return getAllTransactions(null, null, null, null, null, createdSince, createdUntil, null, null); + } + + /** + * Get all transactions + * + * @param balancePlatform {@link String } Query: Unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id). (optional) + * @param paymentInstrumentId {@link String } Query: Unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/paymentInstruments/_id_). (optional) + * @param accountHolderId {@link String } Query: Unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/accountHolders/{id}__queryParam_id). (optional) + * @param balanceAccountId {@link String } Query: Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__queryParam_id). (optional) + * @param cursor {@link String } Query: The `cursor` returned in the links of the previous response. (optional) + * @param createdSince {@link OffsetDateTime } Query: Only include transactions that have been created on or after this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**. (required) + * @param createdUntil {@link OffsetDateTime } Query: Only include transactions that have been created on or before this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**. (required) + * @param limit {@link Integer } Query: The number of items returned per page, maximum of 100 items. By default, the response returns 10 items per page. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TransactionSearchResponse } + * @throws ApiException if fails to make API call + */ + public TransactionSearchResponse getAllTransactions(String balancePlatform, String paymentInstrumentId, String accountHolderId, String balanceAccountId, String cursor, OffsetDateTime createdSince, OffsetDateTime createdUntil, Integer limit, RequestOptions requestOptions) throws ApiException, IOException { + //Add query params + Map queryParams = new HashMap<>(); + if (balancePlatform != null) { + queryParams.put("balancePlatform", balancePlatform); + } + if (paymentInstrumentId != null) { + queryParams.put("paymentInstrumentId", paymentInstrumentId); + } + if (accountHolderId != null) { + queryParams.put("accountHolderId", accountHolderId); + } + if (balanceAccountId != null) { + queryParams.put("balanceAccountId", balanceAccountId); + } + if (cursor != null) { + queryParams.put("cursor", cursor); + } + if (createdSince != null) { + queryParams.put("createdSince", createdSince.toString()); + } + if (createdUntil != null) { + queryParams.put("createdUntil", createdUntil.toString()); + } + if (limit != null) { + queryParams.put("limit", limit.toString()); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/transactions", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, null, queryParams); + return TransactionSearchResponse.fromJson(jsonResult); + } + + /** + * Get a transaction + * + * @param id {@link String } Unique identifier of the transaction. (required) + * @return {@link Transaction } + * @throws ApiException if fails to make API call + */ + public Transaction getTransaction(String id) throws ApiException, IOException { + return getTransaction(id, null); + } + + /** + * Get a transaction + * + * @param id {@link String } Unique identifier of the transaction. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Transaction } + * @throws ApiException if fails to make API call + */ + public Transaction getTransaction(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/transactions/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return Transaction.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/transfers/TransfersApi.java b/src/main/java/com/adyen/service/transfers/TransfersApi.java new file mode 100644 index 000000000..677412cb6 --- /dev/null +++ b/src/main/java/com/adyen/service/transfers/TransfersApi.java @@ -0,0 +1,62 @@ +/* + * Transfers API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.transfers; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.transfers.RestServiceError; +import com.adyen.model.transfers.Transfer; +import com.adyen.model.transfers.TransferInfo; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class TransfersApi extends Service { + private final String baseURL; + + public TransfersApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/btl/v3"); + } + + /** + * Transfer funds + * + * @param transferInfo {@link TransferInfo } (required) + * @return {@link Transfer } + * @throws ApiException if fails to make API call + */ + public Transfer transferFunds(TransferInfo transferInfo) throws ApiException, IOException { + return transferFunds(transferInfo, null); + } + + /** + * Transfer funds + * + * @param transferInfo {@link TransferInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Transfer } + * @throws ApiException if fails to make API call + */ + public Transfer transferFunds(TransferInfo transferInfo, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = transferInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/transfers", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return Transfer.fromJson(jsonResult); + } +} diff --git a/src/test/java/com/adyen/PayoutTest.java b/src/test/java/com/adyen/PayoutTest.java index a161a62cd..d6e48ff69 100644 --- a/src/test/java/com/adyen/PayoutTest.java +++ b/src/test/java/com/adyen/PayoutTest.java @@ -21,8 +21,10 @@ package com.adyen; import com.adyen.model.payout.*; -import com.adyen.service.Payout; import com.adyen.service.exception.ApiException; +import com.adyen.service.payout.InitializationApi; +import com.adyen.service.payout.InstantPayoutsApi; +import com.adyen.service.payout.ReviewingApi; import org.junit.Test; import static com.adyen.constants.ApiConstants.AdditionalData.FRAUD_MANUAL_REVIEW; @@ -37,7 +39,7 @@ public class PayoutTest extends BaseTest { @Test public void testStoreDetailAndSubmitThirdPartySuccess() throws Exception { Client client = createMockClientFromFile("mocks/payout/storeDetailAndSubmitThirdParty-success.json"); - Payout payout = new Payout(client); + InitializationApi payout = new InitializationApi(client); StoreDetailAndSubmitRequest request = new StoreDetailAndSubmitRequest(); StoreDetailAndSubmitResponse result = payout.storeDetailAndSubmitThirdParty(request); @@ -51,7 +53,7 @@ public void testStoreDetailAndSubmitThirdPartySuccess() throws Exception { @Test public void testStoreDetailSuccess() throws Exception { Client client = createMockClientFromFile("mocks/payout/storeDetail-success.json"); - Payout payout = new Payout(client); + InitializationApi payout = new InitializationApi(client); StoreDetailRequest request = new StoreDetailRequest(); StoreDetailResponse result = payout.storeDetail(request); @@ -64,7 +66,7 @@ public void testStoreDetailSuccess() throws Exception { @Test public void testConfirmThirdPartySuccess() throws Exception { Client client = createMockClientFromFile("mocks/payout/modifyResponse-success.json"); - Payout payout = new Payout(client); + ReviewingApi payout = new ReviewingApi(client); ModifyRequest request = new ModifyRequest(); ModifyResponse result = payout.confirmThirdParty(request); @@ -76,10 +78,10 @@ public void testConfirmThirdPartySuccess() throws Exception { @Test public void testSubmitThirdPartySuccess() throws Exception { Client client = createMockClientFromFile("mocks/payout/submitResponse-success.json"); - Payout payout = new Payout(client); + InitializationApi payout = new InitializationApi(client); SubmitRequest request = new SubmitRequest(); - SubmitResponse result = payout.submitThirdparty(request); + SubmitResponse result = payout.submitThirdParty(request); assertEquals("[payout-submit-received]", result.getResultCode()); assertEquals("8815131768219992", result.getPspReference()); @@ -90,7 +92,7 @@ public void testSubmitThirdPartySuccess() throws Exception { @Test public void testDeclineThirdPartySuccess() throws Exception { Client client = createMockClientFromFile("mocks/payout/modifyResponse-success.json"); - Payout payout = new Payout(client); + ReviewingApi payout = new ReviewingApi(client); ModifyRequest request = new ModifyRequest(); ModifyResponse result = payout.declineThirdParty(request); @@ -102,7 +104,7 @@ public void testDeclineThirdPartySuccess() throws Exception { @Test public void testPayoutSuccess() throws Exception { Client client = createMockClientFromFile("mocks/payout/payout-success.json"); - Payout payout = new Payout(client); + InstantPayoutsApi payout = new InstantPayoutsApi(client); PayoutRequest request = new PayoutRequest(); PayoutResponse result = payout.payout(request); @@ -115,7 +117,7 @@ public void testPayoutSuccess() throws Exception { @Test public void testPayoutErrorMerchant() throws Exception { Client client = createMockClientForErrors(403, "mocks/payout/payout-error-403.json"); - Payout payout = new Payout(client); + InstantPayoutsApi payout = new InstantPayoutsApi(client); PayoutRequest request = new PayoutRequest(); @@ -132,7 +134,7 @@ public void testPayoutErrorMerchant() throws Exception { @Test public void testPayoutErrorReference() throws Exception { Client client = createMockClientForErrors(422, "mocks/payout/payout-error-422.json"); - Payout payout = new Payout(client); + InstantPayoutsApi payout = new InstantPayoutsApi(client); PayoutRequest request = new PayoutRequest(); From fcf4dc0697a68954938a3bedefdc31b423fdd3a8 Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot <38424300+AdyenAutomationBot@users.noreply.github.com> Date: Wed, 3 May 2023 15:36:05 +0200 Subject: [PATCH 22/32] Update models (#1000) * [create-pull-request] automated change * fix tests --------- Co-authored-by: jillingk <93914435+jillingk@users.noreply.github.com> --- .../model/balanceplatform/AccountHolder.java | 2 +- .../AccountHolderCapability.java | 2 +- .../model/balanceplatform/BalanceAccount.java | 2 +- .../BalanceSweepConfigurationsResponse.java | 2 +- .../model/balanceplatform/CapitalBalance.java | 306 +++++++++++ .../balanceplatform/CapitalGrantAccount.java | 343 ++++++++++++ .../com/adyen/model/balanceplatform/Fee.java | 217 ++++++++ .../model/balanceplatform/GrantLimit.java | 209 ++++++++ .../model/balanceplatform/GrantOffer.java | 492 ++++++++++++++++++ .../model/balanceplatform/GrantOffers.java | 232 +++++++++ .../com/adyen/model/balanceplatform/JSON.java | 9 + .../model/balanceplatform/JSONObject.java | 2 +- .../MerchantNamesRestriction.java | 2 +- .../balanceplatform/MerchantsRestriction.java | 2 +- .../PaginatedAccountHoldersResponse.java | 2 +- .../PaginatedBalanceAccountsResponse.java | 2 +- .../PaginatedPaymentInstrumentsResponse.java | 2 +- .../model/balanceplatform/Repayment.java | 280 ++++++++++ .../model/balanceplatform/RepaymentTerm.java | 241 +++++++++ .../balanceplatform/RestServiceError.java | 2 +- .../balanceplatform/ThresholdRepayment.java | 217 ++++++++ .../TransactionRulesResponse.java | 2 +- .../binlookup/AbstractOpenApiSchema.java | 3 +- .../com/adyen/model/binlookup/Amount.java | 3 +- .../com/adyen/model/binlookup/BinDetail.java | 3 +- .../com/adyen/model/binlookup/CardBin.java | 38 +- .../binlookup/CostEstimateAssumptions.java | 3 +- .../model/binlookup/CostEstimateRequest.java | 3 +- .../model/binlookup/CostEstimateResponse.java | 3 +- .../model/binlookup/DSPublicKeyDetail.java | 3 +- .../java/com/adyen/model/binlookup/JSON.java | 3 +- .../model/binlookup/MerchantDetails.java | 3 +- .../com/adyen/model/binlookup/Recurring.java | 3 +- .../adyen/model/binlookup/ServiceError.java | 3 +- .../binlookup/ThreeDS2CardRangeDetail.java | 49 +- .../binlookup/ThreeDSAvailabilityRequest.java | 3 +- .../ThreeDSAvailabilityResponse.java | 7 +- .../model/checkout/AdditionalDataAirline.java | 112 ++-- .../checkout/AdditionalDataCarRental.java | 92 ++-- .../model/checkout/AdditionalDataLevel23.java | 68 +-- .../model/checkout/AdditionalDataLodging.java | 91 ++-- .../AdditionalDataTemporaryServices.java | 36 +- .../com/adyen/model/checkout/CardDetails.java | 4 +- .../model/checkout/CardDetailsResponse.java | 2 +- .../checkout/CheckoutBalanceCheckRequest.java | 2 +- .../CreateCheckoutSessionRequest.java | 4 +- .../CreateCheckoutSessionResponse.java | 4 +- .../CreatePaymentAmountUpdateRequest.java | 2 +- .../checkout/CreatePaymentCaptureRequest.java | 4 +- .../checkout/CreatePaymentLinkRequest.java | 4 +- .../checkout/CreatePaymentRefundRequest.java | 4 +- .../com/adyen/model/checkout/FraudResult.java | 2 +- .../com/adyen/model/checkout/InputDetail.java | 6 +- .../ListStoredPaymentMethodsResponse.java | 2 +- .../checkout/PaymentAmountUpdateResource.java | 2 +- .../checkout/PaymentCaptureResource.java | 4 +- .../checkout/PaymentDonationRequest.java | 4 +- .../model/checkout/PaymentLinkResponse.java | 4 +- .../adyen/model/checkout/PaymentMethod.java | 4 +- .../checkout/PaymentMethodsResponse.java | 4 +- .../model/checkout/PaymentRefundResource.java | 4 +- .../adyen/model/checkout/PaymentRequest.java | 4 +- .../model/checkout/PaymentSetupRequest.java | 4 +- .../model/checkout/PaymentSetupResponse.java | 2 +- .../adyen/model/checkout/RecurringDetail.java | 4 +- .../adyen/model/checkout/SubInputDetail.java | 2 +- .../CapabilityProblemEntity.java | 4 +- .../CapabilityProblemEntityRecursive.java | 4 +- .../TransferInstrumentReference.java | 32 +- .../management/AllowedOriginsResponse.java | 2 +- .../model/management/AndroidAppsResponse.java | 2 +- .../AndroidCertificatesResponse.java | 2 +- .../adyen/model/management/ApiCredential.java | 2 +- .../management/BillingEntitiesResponse.java | 2 +- .../com/adyen/model/management/Company.java | 2 +- .../management/CompanyApiCredential.java | 2 +- .../CreateApiCredentialResponse.java | 2 +- .../CreateCompanyApiCredentialResponse.java | 2 +- .../com/adyen/model/management/EventUrl.java | 4 +- .../adyen/model/management/JSONObject.java | 2 +- .../ListCompanyApiCredentialsResponse.java | 2 +- .../model/management/ListCompanyResponse.java | 2 +- .../management/ListCompanyUsersResponse.java | 2 +- .../ListExternalTerminalActionsResponse.java | 2 +- .../ListMerchantApiCredentialsResponse.java | 2 +- .../management/ListMerchantResponse.java | 2 +- .../management/ListMerchantUsersResponse.java | 2 +- .../model/management/ListStoresResponse.java | 2 +- .../management/ListTerminalsResponse.java | 2 +- .../management/ListWebhooksResponse.java | 2 +- .../model/management/MeApiCredential.java | 2 +- .../com/adyen/model/management/Merchant.java | 2 +- .../model/management/ModelConfiguration.java | 2 +- .../model/management/NotificationUrl.java | 4 +- .../model/management/OfflineProcessing.java | 2 +- .../management/PaymentMethodResponse.java | 2 +- .../management/PayoutSettingsResponse.java | 2 +- .../model/management/RestServiceError.java | 2 +- .../ScheduleTerminalActionsResponse.java | 2 +- .../management/ShippingLocationsResponse.java | 2 +- .../com/adyen/model/management/Surcharge.java | 2 +- .../management/TerminalModelsResponse.java | 2 +- .../adyen/model/management/TerminalOrder.java | 2 +- .../management/TerminalOrderRequest.java | 2 +- .../management/TerminalOrdersResponse.java | 2 +- .../management/TerminalProductsResponse.java | 2 +- .../model/management/TerminalSettings.java | 2 +- .../model/management/TestWebhookResponse.java | 2 +- .../adyen/model/management/WifiProfiles.java | 2 +- .../model/payments/AdditionalDataLodging.java | 68 +-- .../payments/AdjustAuthorisationRequest.java | 2 +- .../adyen/model/payments/CancelRequest.java | 2 +- .../adyen/model/payments/CaptureRequest.java | 2 +- .../java/com/adyen/model/payments/Card.java | 13 +- .../payments/FraudCheckResultWrapper.java | 209 ++++++++ .../com/adyen/model/payments/FraudResult.java | 16 +- .../java/com/adyen/model/payments/JSON.java | 1 + .../adyen/model/payments/PaymentRequest.java | 12 +- .../model/payments/PaymentRequest3d.java | 12 +- .../model/payments/PaymentRequest3ds2.java | 12 +- .../payments/PlatformChargebackLogic.java | 35 +- .../adyen/model/payments/RefundRequest.java | 2 +- .../payments/TechnicalCancelRequest.java | 2 +- .../payments/VoidPendingRefundRequest.java | 2 +- .../com/adyen/model/payout/FraudResult.java | 2 +- .../recurring/AbstractOpenApiSchema.java | 1 + .../com/adyen/model/recurring/Address.java | 1 + .../com/adyen/model/recurring/Amount.java | 1 + .../adyen/model/recurring/BankAccount.java | 1 + .../java/com/adyen/model/recurring/Card.java | 1 + .../model/recurring/CreatePermitRequest.java | 3 +- .../model/recurring/CreatePermitResult.java | 3 +- .../model/recurring/DisablePermitRequest.java | 1 + .../model/recurring/DisablePermitResult.java | 1 + .../adyen/model/recurring/DisableRequest.java | 1 + .../adyen/model/recurring/DisableResult.java | 1 + .../java/com/adyen/model/recurring/JSON.java | 1 + .../java/com/adyen/model/recurring/Name.java | 1 + .../model/recurring/NotifyShopperRequest.java | 1 + .../model/recurring/NotifyShopperResult.java | 1 + .../com/adyen/model/recurring/Permit.java | 1 + .../model/recurring/PermitRestriction.java | 1 + .../adyen/model/recurring/PermitResult.java | 1 + .../com/adyen/model/recurring/Recurring.java | 1 + .../model/recurring/RecurringDetail.java | 1 + .../recurring/RecurringDetailWrapper.java | 1 + .../recurring/RecurringDetailsRequest.java | 1 + .../recurring/RecurringDetailsResult.java | 3 +- .../ScheduleAccountUpdaterRequest.java | 1 + .../ScheduleAccountUpdaterResult.java | 1 + .../adyen/model/recurring/ServiceError.java | 1 + .../adyen/model/recurring/TokenDetails.java | 1 + .../com/adyen/model/transfers/Address2.java | 4 +- .../java/com/adyen/model/transfers/JSON.java | 3 + .../com/adyen/model/transfers/JSONObject.java | 2 +- .../model/transfers/PartyIdentification2.java | 47 +- .../model/transfers/PaymentInstrument.java | 307 +++++++++++ .../model/transfers/ResourceReference.java | 274 ++++++++++ .../model/transfers/RestServiceError.java | 2 +- .../transfers/TransactionSearchResponse.java | 2 +- .../com/adyen/model/transfers/Transfer.java | 113 +++- .../adyen/model/transfers/TransferInfo.java | 38 +- .../UltimatePartyIdentification.java | 464 +++++++++++++++++ src/test/java/com/adyen/MarketPayTest.java | 2 +- src/test/java/com/adyen/PaymentTest.java | 2 +- .../mocks/authorise-error-cvc-declined.json | 65 ++- .../mocks/authorise-error-expired.json | 65 ++- .../resources/mocks/authorise-success-3d.json | 65 ++- .../mocks/authorise-success-cse.json | 65 ++- .../resources/mocks/authorise-success.json | 22 + .../resources/mocks/authorise3d-success.json | 69 ++- 171 files changed, 4778 insertions(+), 563 deletions(-) create mode 100644 src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/Fee.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/GrantLimit.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/GrantOffer.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/GrantOffers.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/Repayment.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java create mode 100644 src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java create mode 100644 src/main/java/com/adyen/model/payments/FraudCheckResultWrapper.java create mode 100644 src/main/java/com/adyen/model/transfers/PaymentInstrument.java create mode 100644 src/main/java/com/adyen/model/transfers/ResourceReference.java create mode 100644 src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java index 99f10ad6f..ca3ec233a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java @@ -556,7 +556,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `verificationDeadlines` (array) for (int i = 0; i < jsonArrayverificationDeadlines.size(); i++) { VerificationDeadline.validateJsonObject(jsonArrayverificationDeadlines.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java index e15c34796..0f6543ff6 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java @@ -590,7 +590,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `transferInstruments` (array) for (int i = 0; i < jsonArraytransferInstruments.size(); i++) { AccountSupportingEntityCapability.validateJsonObject(jsonArraytransferInstruments.get(i).getAsJsonObject()); - }; + } } // ensure the field verificationStatus can be parsed to an enum value if (jsonObj.get("verificationStatus") != null) { diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java index f150ef31b..ce47f790c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java @@ -438,7 +438,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `balances` (array) for (int i = 0; i < jsonArraybalances.size(); i++) { Balance.validateJsonObject(jsonArraybalances.get(i).getAsJsonObject()); - }; + } } // validate the optional field defaultCurrencyCode if (jsonObj.get("defaultCurrencyCode") != null && !jsonObj.get("defaultCurrencyCode").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java b/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java index e7b16743e..318e48a5e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java @@ -236,7 +236,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `sweeps` (array) for (int i = 0; i < jsonArraysweeps.size(); i++) { SweepConfigurationV2.validateJsonObject(jsonArraysweeps.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java b/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java new file mode 100644 index 000000000..469daec01 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java @@ -0,0 +1,306 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * CapitalBalance + */ + +public class CapitalBalance { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_FEE = "fee"; + @SerializedName(SERIALIZED_NAME_FEE) + private Long fee; + + public static final String SERIALIZED_NAME_PRINCIPAL = "principal"; + @SerializedName(SERIALIZED_NAME_PRINCIPAL) + private Long principal; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + private Long total; + + public CapitalBalance() { + } + + public CapitalBalance currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @return currency + **/ + @ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).") + + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + + public CapitalBalance fee(Long fee) { + + this.fee = fee; + return this; + } + + /** + * Fee amount. + * @return fee + **/ + @ApiModelProperty(required = true, value = "Fee amount.") + + public Long getFee() { + return fee; + } + + + public void setFee(Long fee) { + this.fee = fee; + } + + + public CapitalBalance principal(Long principal) { + + this.principal = principal; + return this; + } + + /** + * Principal amount. + * @return principal + **/ + @ApiModelProperty(required = true, value = "Principal amount.") + + public Long getPrincipal() { + return principal; + } + + + public void setPrincipal(Long principal) { + this.principal = principal; + } + + + public CapitalBalance total(Long total) { + + this.total = total; + return this; + } + + /** + * Total amount. A sum of principal amount and fee amount. + * @return total + **/ + @ApiModelProperty(required = true, value = "Total amount. A sum of principal amount and fee amount.") + + public Long getTotal() { + return total; + } + + + public void setTotal(Long total) { + this.total = total; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CapitalBalance capitalBalance = (CapitalBalance) o; + return Objects.equals(this.currency, capitalBalance.currency) && + Objects.equals(this.fee, capitalBalance.fee) && + Objects.equals(this.principal, capitalBalance.principal) && + Objects.equals(this.total, capitalBalance.total); + } + + @Override + public int hashCode() { + return Objects.hash(currency, fee, principal, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CapitalBalance {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" principal: ").append(toIndentedString(principal)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("currency"); + openapiFields.add("fee"); + openapiFields.add("principal"); + openapiFields.add("total"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("currency"); + openapiRequiredFields.add("fee"); + openapiRequiredFields.add("principal"); + openapiRequiredFields.add("total"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CapitalBalance + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CapitalBalance.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CapitalBalance is not found in the empty JSON string", CapitalBalance.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CapitalBalance.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CapitalBalance` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CapitalBalance.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field currency + if (jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CapitalBalance.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CapitalBalance' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CapitalBalance.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CapitalBalance value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CapitalBalance read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CapitalBalance given an JSON string + * + * @param jsonString JSON string + * @return An instance of CapitalBalance + * @throws IOException if the JSON string is invalid with respect to CapitalBalance + */ + public static CapitalBalance fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CapitalBalance.class); + } + + /** + * Convert an instance of CapitalBalance to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java b/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java new file mode 100644 index 000000000..4cce53442 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java @@ -0,0 +1,343 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balanceplatform.CapitalBalance; +import com.adyen.model.balanceplatform.GrantLimit; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * CapitalGrantAccount + */ + +public class CapitalGrantAccount { + public static final String SERIALIZED_NAME_BALANCES = "balances"; + @SerializedName(SERIALIZED_NAME_BALANCES) + private List balances = null; + + public static final String SERIALIZED_NAME_FUNDING_BALANCE_ACCOUNT_ID = "fundingBalanceAccountId"; + @SerializedName(SERIALIZED_NAME_FUNDING_BALANCE_ACCOUNT_ID) + private String fundingBalanceAccountId; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_LIMITS = "limits"; + @SerializedName(SERIALIZED_NAME_LIMITS) + private List limits = null; + + public CapitalGrantAccount() { + } + + public CapitalGrantAccount balances(List balances) { + + this.balances = balances; + return this; + } + + public CapitalGrantAccount addBalancesItem(CapitalBalance balancesItem) { + if (this.balances == null) { + this.balances = new ArrayList<>(); + } + this.balances.add(balancesItem); + return this; + } + + /** + * The balances of the grant account. + * @return balances + **/ + @ApiModelProperty(value = "The balances of the grant account.") + + public List getBalances() { + return balances; + } + + + public void setBalances(List balances) { + this.balances = balances; + } + + + public CapitalGrantAccount fundingBalanceAccountId(String fundingBalanceAccountId) { + + this.fundingBalanceAccountId = fundingBalanceAccountId; + return this; + } + + /** + * The unique identifier of the balance account used to fund the grant. + * @return fundingBalanceAccountId + **/ + @ApiModelProperty(value = "The unique identifier of the balance account used to fund the grant.") + + public String getFundingBalanceAccountId() { + return fundingBalanceAccountId; + } + + + public void setFundingBalanceAccountId(String fundingBalanceAccountId) { + this.fundingBalanceAccountId = fundingBalanceAccountId; + } + + + public CapitalGrantAccount id(String id) { + + this.id = id; + return this; + } + + /** + * The identifier of the grant account. + * @return id + **/ + @ApiModelProperty(value = "The identifier of the grant account.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public CapitalGrantAccount limits(List limits) { + + this.limits = limits; + return this; + } + + public CapitalGrantAccount addLimitsItem(GrantLimit limitsItem) { + if (this.limits == null) { + this.limits = new ArrayList<>(); + } + this.limits.add(limitsItem); + return this; + } + + /** + * The limits of the grant account. + * @return limits + **/ + @ApiModelProperty(value = "The limits of the grant account.") + + public List getLimits() { + return limits; + } + + + public void setLimits(List limits) { + this.limits = limits; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CapitalGrantAccount capitalGrantAccount = (CapitalGrantAccount) o; + return Objects.equals(this.balances, capitalGrantAccount.balances) && + Objects.equals(this.fundingBalanceAccountId, capitalGrantAccount.fundingBalanceAccountId) && + Objects.equals(this.id, capitalGrantAccount.id) && + Objects.equals(this.limits, capitalGrantAccount.limits); + } + + @Override + public int hashCode() { + return Objects.hash(balances, fundingBalanceAccountId, id, limits); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CapitalGrantAccount {\n"); + sb.append(" balances: ").append(toIndentedString(balances)).append("\n"); + sb.append(" fundingBalanceAccountId: ").append(toIndentedString(fundingBalanceAccountId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" limits: ").append(toIndentedString(limits)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("balances"); + openapiFields.add("fundingBalanceAccountId"); + openapiFields.add("id"); + openapiFields.add("limits"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CapitalGrantAccount + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CapitalGrantAccount.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CapitalGrantAccount is not found in the empty JSON string", CapitalGrantAccount.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CapitalGrantAccount.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CapitalGrantAccount` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArraybalances = jsonObj.getAsJsonArray("balances"); + if (jsonArraybalances != null) { + // ensure the json data is an array + if (!jsonObj.get("balances").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `balances` to be an array in the JSON string but got `%s`", jsonObj.get("balances").toString())); + } + + // validate the optional field `balances` (array) + for (int i = 0; i < jsonArraybalances.size(); i++) { + CapitalBalance.validateJsonObject(jsonArraybalances.get(i).getAsJsonObject()); + } + } + // validate the optional field fundingBalanceAccountId + if (jsonObj.get("fundingBalanceAccountId") != null && !jsonObj.get("fundingBalanceAccountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fundingBalanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fundingBalanceAccountId").toString())); + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + JsonArray jsonArraylimits = jsonObj.getAsJsonArray("limits"); + if (jsonArraylimits != null) { + // ensure the json data is an array + if (!jsonObj.get("limits").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `limits` to be an array in the JSON string but got `%s`", jsonObj.get("limits").toString())); + } + + // validate the optional field `limits` (array) + for (int i = 0; i < jsonArraylimits.size(); i++) { + GrantLimit.validateJsonObject(jsonArraylimits.get(i).getAsJsonObject()); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CapitalGrantAccount.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CapitalGrantAccount' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CapitalGrantAccount.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CapitalGrantAccount value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CapitalGrantAccount read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CapitalGrantAccount given an JSON string + * + * @param jsonString JSON string + * @return An instance of CapitalGrantAccount + * @throws IOException if the JSON string is invalid with respect to CapitalGrantAccount + */ + public static CapitalGrantAccount fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CapitalGrantAccount.class); + } + + /** + * Convert an instance of CapitalGrantAccount to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/Fee.java b/src/main/java/com/adyen/model/balanceplatform/Fee.java new file mode 100644 index 000000000..a4707e663 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/Fee.java @@ -0,0 +1,217 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balanceplatform.Amount; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * Fee + */ + +public class Fee { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; + + public Fee() { + } + + public Fee amount(Amount amount) { + + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + **/ + @ApiModelProperty(required = true, value = "") + + public Amount getAmount() { + return amount; + } + + + public void setAmount(Amount amount) { + this.amount = amount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Fee fee = (Fee) o; + return Objects.equals(this.amount, fee.amount); + } + + @Override + public int hashCode() { + return Objects.hash(amount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Fee {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("amount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("amount"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Fee + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Fee.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Fee is not found in the empty JSON string", Fee.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Fee.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Fee` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Fee.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Fee.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Fee' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Fee.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Fee value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Fee read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Fee given an JSON string + * + * @param jsonString JSON string + * @return An instance of Fee + * @throws IOException if the JSON string is invalid with respect to Fee + */ + public static Fee fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Fee.class); + } + + /** + * Convert an instance of Fee to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java b/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java new file mode 100644 index 000000000..f9db1458f --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java @@ -0,0 +1,209 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balanceplatform.Amount; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * GrantLimit + */ + +public class GrantLimit { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; + + public GrantLimit() { + } + + public GrantLimit amount(Amount amount) { + + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + **/ + @ApiModelProperty(value = "") + + public Amount getAmount() { + return amount; + } + + + public void setAmount(Amount amount) { + this.amount = amount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GrantLimit grantLimit = (GrantLimit) o; + return Objects.equals(this.amount, grantLimit.amount); + } + + @Override + public int hashCode() { + return Objects.hash(amount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrantLimit {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("amount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GrantLimit + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GrantLimit.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GrantLimit is not found in the empty JSON string", GrantLimit.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GrantLimit.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GrantLimit` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GrantLimit.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GrantLimit' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GrantLimit.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GrantLimit value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GrantLimit read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GrantLimit given an JSON string + * + * @param jsonString JSON string + * @return An instance of GrantLimit + * @throws IOException if the JSON string is invalid with respect to GrantLimit + */ + public static GrantLimit fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GrantLimit.class); + } + + /** + * Convert an instance of GrantLimit to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java b/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java new file mode 100644 index 000000000..34553cf57 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java @@ -0,0 +1,492 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balanceplatform.Amount; +import com.adyen.model.balanceplatform.Fee; +import com.adyen.model.balanceplatform.Repayment; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * GrantOffer + */ + +public class GrantOffer { + public static final String SERIALIZED_NAME_ACCOUNT_HOLDER_ID = "accountHolderId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_HOLDER_ID) + private String accountHolderId; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; + + /** + * The contract type of the grant offer. Possible value: **cashAdvance**, **loan**. + */ + @JsonAdapter(ContractTypeEnum.Adapter.class) + public enum ContractTypeEnum { + CASHADVANCE("cashAdvance"), + + LOAN("loan"); + + private String value; + + ContractTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ContractTypeEnum fromValue(String value) { + for (ContractTypeEnum b : ContractTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ContractTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ContractTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ContractTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_CONTRACT_TYPE = "contractType"; + @SerializedName(SERIALIZED_NAME_CONTRACT_TYPE) + private ContractTypeEnum contractType; + + public static final String SERIALIZED_NAME_EXPIRES_AT = "expiresAt"; + @SerializedName(SERIALIZED_NAME_EXPIRES_AT) + private Object expiresAt; + + public static final String SERIALIZED_NAME_FEE = "fee"; + @SerializedName(SERIALIZED_NAME_FEE) + private Fee fee; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_REPAYMENT = "repayment"; + @SerializedName(SERIALIZED_NAME_REPAYMENT) + private Repayment repayment; + + public static final String SERIALIZED_NAME_STARTS_AT = "startsAt"; + @SerializedName(SERIALIZED_NAME_STARTS_AT) + private Object startsAt; + + public GrantOffer() { + } + + public GrantOffer accountHolderId(String accountHolderId) { + + this.accountHolderId = accountHolderId; + return this; + } + + /** + * The identifier of the account holder to which the grant is offered. + * @return accountHolderId + **/ + @ApiModelProperty(required = true, value = "The identifier of the account holder to which the grant is offered.") + + public String getAccountHolderId() { + return accountHolderId; + } + + + public void setAccountHolderId(String accountHolderId) { + this.accountHolderId = accountHolderId; + } + + + public GrantOffer amount(Amount amount) { + + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + **/ + @ApiModelProperty(value = "") + + public Amount getAmount() { + return amount; + } + + + public void setAmount(Amount amount) { + this.amount = amount; + } + + + public GrantOffer contractType(ContractTypeEnum contractType) { + + this.contractType = contractType; + return this; + } + + /** + * The contract type of the grant offer. Possible value: **cashAdvance**, **loan**. + * @return contractType + **/ + @ApiModelProperty(value = "The contract type of the grant offer. Possible value: **cashAdvance**, **loan**.") + + public ContractTypeEnum getContractType() { + return contractType; + } + + + public void setContractType(ContractTypeEnum contractType) { + this.contractType = contractType; + } + + + public GrantOffer expiresAt(Object expiresAt) { + + this.expiresAt = expiresAt; + return this; + } + + /** + * Get expiresAt + * @return expiresAt + **/ + @ApiModelProperty(value = "") + + public Object getExpiresAt() { + return expiresAt; + } + + + public void setExpiresAt(Object expiresAt) { + this.expiresAt = expiresAt; + } + + + public GrantOffer fee(Fee fee) { + + this.fee = fee; + return this; + } + + /** + * Get fee + * @return fee + **/ + @ApiModelProperty(value = "") + + public Fee getFee() { + return fee; + } + + + public void setFee(Fee fee) { + this.fee = fee; + } + + + public GrantOffer id(String id) { + + this.id = id; + return this; + } + + /** + * The unique identifier of the grant offer. + * @return id + **/ + @ApiModelProperty(value = "The unique identifier of the grant offer.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public GrantOffer repayment(Repayment repayment) { + + this.repayment = repayment; + return this; + } + + /** + * Get repayment + * @return repayment + **/ + @ApiModelProperty(value = "") + + public Repayment getRepayment() { + return repayment; + } + + + public void setRepayment(Repayment repayment) { + this.repayment = repayment; + } + + + public GrantOffer startsAt(Object startsAt) { + + this.startsAt = startsAt; + return this; + } + + /** + * Get startsAt + * @return startsAt + **/ + @ApiModelProperty(value = "") + + public Object getStartsAt() { + return startsAt; + } + + + public void setStartsAt(Object startsAt) { + this.startsAt = startsAt; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GrantOffer grantOffer = (GrantOffer) o; + return Objects.equals(this.accountHolderId, grantOffer.accountHolderId) && + Objects.equals(this.amount, grantOffer.amount) && + Objects.equals(this.contractType, grantOffer.contractType) && + Objects.equals(this.expiresAt, grantOffer.expiresAt) && + Objects.equals(this.fee, grantOffer.fee) && + Objects.equals(this.id, grantOffer.id) && + Objects.equals(this.repayment, grantOffer.repayment) && + Objects.equals(this.startsAt, grantOffer.startsAt); + } + + @Override + public int hashCode() { + return Objects.hash(accountHolderId, amount, contractType, expiresAt, fee, id, repayment, startsAt); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrantOffer {\n"); + sb.append(" accountHolderId: ").append(toIndentedString(accountHolderId)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" contractType: ").append(toIndentedString(contractType)).append("\n"); + sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" repayment: ").append(toIndentedString(repayment)).append("\n"); + sb.append(" startsAt: ").append(toIndentedString(startsAt)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountHolderId"); + openapiFields.add("amount"); + openapiFields.add("contractType"); + openapiFields.add("expiresAt"); + openapiFields.add("fee"); + openapiFields.add("id"); + openapiFields.add("repayment"); + openapiFields.add("startsAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountHolderId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GrantOffer + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GrantOffer.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GrantOffer is not found in the empty JSON string", GrantOffer.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GrantOffer.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GrantOffer` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GrantOffer.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field accountHolderId + if (jsonObj.get("accountHolderId") != null && !jsonObj.get("accountHolderId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountHolderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountHolderId").toString())); + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + // ensure the field contractType can be parsed to an enum value + if (jsonObj.get("contractType") != null) { + if(!jsonObj.get("contractType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `contractType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contractType").toString())); + } + ContractTypeEnum.fromValue(jsonObj.get("contractType").getAsString()); + } + // validate the optional field `fee` + if (jsonObj.getAsJsonObject("fee") != null) { + Fee.validateJsonObject(jsonObj.getAsJsonObject("fee")); + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field `repayment` + if (jsonObj.getAsJsonObject("repayment") != null) { + Repayment.validateJsonObject(jsonObj.getAsJsonObject("repayment")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GrantOffer.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GrantOffer' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GrantOffer.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GrantOffer value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GrantOffer read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GrantOffer given an JSON string + * + * @param jsonString JSON string + * @return An instance of GrantOffer + * @throws IOException if the JSON string is invalid with respect to GrantOffer + */ + public static GrantOffer fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GrantOffer.class); + } + + /** + * Convert an instance of GrantOffer to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java b/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java new file mode 100644 index 000000000..a2ad92430 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java @@ -0,0 +1,232 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balanceplatform.GrantOffer; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * GrantOffers + */ + +public class GrantOffers { + public static final String SERIALIZED_NAME_GRANT_OFFERS = "grantOffers"; + @SerializedName(SERIALIZED_NAME_GRANT_OFFERS) + private List grantOffers = new ArrayList<>(); + + public GrantOffers() { + } + + public GrantOffers grantOffers(List grantOffers) { + + this.grantOffers = grantOffers; + return this; + } + + public GrantOffers addGrantOffersItem(GrantOffer grantOffersItem) { + this.grantOffers.add(grantOffersItem); + return this; + } + + /** + * A list of available grant offers. + * @return grantOffers + **/ + @ApiModelProperty(required = true, value = "A list of available grant offers.") + + public List getGrantOffers() { + return grantOffers; + } + + + public void setGrantOffers(List grantOffers) { + this.grantOffers = grantOffers; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GrantOffers grantOffers = (GrantOffers) o; + return Objects.equals(this.grantOffers, grantOffers.grantOffers); + } + + @Override + public int hashCode() { + return Objects.hash(grantOffers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrantOffers {\n"); + sb.append(" grantOffers: ").append(toIndentedString(grantOffers)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("grantOffers"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("grantOffers"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GrantOffers + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GrantOffers.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GrantOffers is not found in the empty JSON string", GrantOffers.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GrantOffers.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GrantOffers` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GrantOffers.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + JsonArray jsonArraygrantOffers = jsonObj.getAsJsonArray("grantOffers"); + if (jsonArraygrantOffers != null) { + // ensure the json data is an array + if (!jsonObj.get("grantOffers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `grantOffers` to be an array in the JSON string but got `%s`", jsonObj.get("grantOffers").toString())); + } + + // validate the optional field `grantOffers` (array) + for (int i = 0; i < jsonArraygrantOffers.size(); i++) { + GrantOffer.validateJsonObject(jsonArraygrantOffers.get(i).getAsJsonObject()); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GrantOffers.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GrantOffers' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GrantOffers.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GrantOffers value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GrantOffers read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GrantOffers given an JSON string + * + * @param jsonString JSON string + * @return An instance of GrantOffers + * @throws IOException if the JSON string is invalid with respect to GrantOffers + */ + public static GrantOffers fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GrantOffers.class); + } + + /** + * Convert an instance of GrantOffers to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/JSON.java b/src/main/java/com/adyen/model/balanceplatform/JSON.java index 3bd9506fa..ffbb105be 100644 --- a/src/main/java/com/adyen/model/balanceplatform/JSON.java +++ b/src/main/java/com/adyen/model/balanceplatform/JSON.java @@ -116,6 +116,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.BulkAddress.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.CALocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.CZLocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.CapitalBalance.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.CapitalGrantAccount.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Card.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.CardConfiguration.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.CardInfo.CustomTypeAdapterFactory()); @@ -128,6 +130,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Duration.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.EntryModesRestriction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Expiry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Fee.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.GrantLimit.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.GrantOffer.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.GrantOffers.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.HULocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.IbanAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.InternationalTransactionRestriction.CustomTypeAdapterFactory()); @@ -156,6 +162,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Phone.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.PhoneNumber.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.ProcessingTypesRestriction.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Repayment.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.RepaymentTerm.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.RestServiceError.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.SELocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.SGLocalAccountIdentification.CustomTypeAdapterFactory()); @@ -164,6 +172,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.SweepConfigurationV2Schedule.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.SweepCounterparty.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.SweepSchedule.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.ThresholdRepayment.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.TimeOfDay.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.TimeOfDayRestriction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.TotalAmountRestriction.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/adyen/model/balanceplatform/JSONObject.java b/src/main/java/com/adyen/model/balanceplatform/JSONObject.java index 1ab96a7b7..89c912411 100644 --- a/src/main/java/com/adyen/model/balanceplatform/JSONObject.java +++ b/src/main/java/com/adyen/model/balanceplatform/JSONObject.java @@ -200,7 +200,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `paths` (array) for (int i = 0; i < jsonArraypaths.size(); i++) { JSONPath.validateJsonObject(jsonArraypaths.get(i).getAsJsonObject()); - }; + } } // validate the optional field `rootPath` if (jsonObj.getAsJsonObject("rootPath") != null) { diff --git a/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java index 069c66538..601e63477 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java @@ -212,7 +212,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `value` (array) for (int i = 0; i < jsonArrayvalue.size(); i++) { StringMatch.validateJsonObject(jsonArrayvalue.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java index b164aa8b5..4a90412d9 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java @@ -212,7 +212,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `value` (array) for (int i = 0; i < jsonArrayvalue.size(); i++) { MerchantAcquirerPair.validateJsonObject(jsonArrayvalue.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java index eba7c70c9..6b4dcce10 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java @@ -236,7 +236,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `accountHolders` (array) for (int i = 0; i < jsonArrayaccountHolders.size(); i++) { AccountHolder.validateJsonObject(jsonArrayaccountHolders.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java index a2fa28b67..d8c97a1d1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java @@ -236,7 +236,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `balanceAccounts` (array) for (int i = 0; i < jsonArraybalanceAccounts.size(); i++) { BalanceAccountBase.validateJsonObject(jsonArraybalanceAccounts.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java index 1533f71ee..b79a5586b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java @@ -236,7 +236,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `paymentInstruments` (array) for (int i = 0; i < jsonArraypaymentInstruments.size(); i++) { PaymentInstrument.validateJsonObject(jsonArraypaymentInstruments.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/balanceplatform/Repayment.java b/src/main/java/com/adyen/model/balanceplatform/Repayment.java new file mode 100644 index 000000000..01df3f3e6 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/Repayment.java @@ -0,0 +1,280 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balanceplatform.RepaymentTerm; +import com.adyen.model.balanceplatform.ThresholdRepayment; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * Repayment + */ + +public class Repayment { + public static final String SERIALIZED_NAME_BASIS_POINTS = "basisPoints"; + @SerializedName(SERIALIZED_NAME_BASIS_POINTS) + private Integer basisPoints; + + public static final String SERIALIZED_NAME_TERM = "term"; + @SerializedName(SERIALIZED_NAME_TERM) + private RepaymentTerm term; + + public static final String SERIALIZED_NAME_THRESHOLD = "threshold"; + @SerializedName(SERIALIZED_NAME_THRESHOLD) + private ThresholdRepayment threshold; + + public Repayment() { + } + + public Repayment basisPoints(Integer basisPoints) { + + this.basisPoints = basisPoints; + return this; + } + + /** + * The repayment that is deducted daily from incoming net volume, in [basis points](https://www.investopedia.com/terms/b/basispoint.asp). + * @return basisPoints + **/ + @ApiModelProperty(required = true, value = "The repayment that is deducted daily from incoming net volume, in [basis points](https://www.investopedia.com/terms/b/basispoint.asp).") + + public Integer getBasisPoints() { + return basisPoints; + } + + + public void setBasisPoints(Integer basisPoints) { + this.basisPoints = basisPoints; + } + + + public Repayment term(RepaymentTerm term) { + + this.term = term; + return this; + } + + /** + * Get term + * @return term + **/ + @ApiModelProperty(value = "") + + public RepaymentTerm getTerm() { + return term; + } + + + public void setTerm(RepaymentTerm term) { + this.term = term; + } + + + public Repayment threshold(ThresholdRepayment threshold) { + + this.threshold = threshold; + return this; + } + + /** + * Get threshold + * @return threshold + **/ + @ApiModelProperty(value = "") + + public ThresholdRepayment getThreshold() { + return threshold; + } + + + public void setThreshold(ThresholdRepayment threshold) { + this.threshold = threshold; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Repayment repayment = (Repayment) o; + return Objects.equals(this.basisPoints, repayment.basisPoints) && + Objects.equals(this.term, repayment.term) && + Objects.equals(this.threshold, repayment.threshold); + } + + @Override + public int hashCode() { + return Objects.hash(basisPoints, term, threshold); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Repayment {\n"); + sb.append(" basisPoints: ").append(toIndentedString(basisPoints)).append("\n"); + sb.append(" term: ").append(toIndentedString(term)).append("\n"); + sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("basisPoints"); + openapiFields.add("term"); + openapiFields.add("threshold"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("basisPoints"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Repayment + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Repayment.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Repayment is not found in the empty JSON string", Repayment.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Repayment.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Repayment` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Repayment.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `term` + if (jsonObj.getAsJsonObject("term") != null) { + RepaymentTerm.validateJsonObject(jsonObj.getAsJsonObject("term")); + } + // validate the optional field `threshold` + if (jsonObj.getAsJsonObject("threshold") != null) { + ThresholdRepayment.validateJsonObject(jsonObj.getAsJsonObject("threshold")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Repayment.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Repayment' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Repayment.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Repayment value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Repayment read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Repayment given an JSON string + * + * @param jsonString JSON string + * @return An instance of Repayment + * @throws IOException if the JSON string is invalid with respect to Repayment + */ + public static Repayment fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Repayment.class); + } + + /** + * Convert an instance of Repayment to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java b/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java new file mode 100644 index 000000000..7faac34d6 --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java @@ -0,0 +1,241 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * RepaymentTerm + */ + +public class RepaymentTerm { + public static final String SERIALIZED_NAME_ESTIMATED_DAYS = "estimatedDays"; + @SerializedName(SERIALIZED_NAME_ESTIMATED_DAYS) + private Integer estimatedDays; + + public static final String SERIALIZED_NAME_MAXIMUM_DAYS = "maximumDays"; + @SerializedName(SERIALIZED_NAME_MAXIMUM_DAYS) + private Integer maximumDays; + + public RepaymentTerm() { + } + + public RepaymentTerm estimatedDays(Integer estimatedDays) { + + this.estimatedDays = estimatedDays; + return this; + } + + /** + * The estimated term for repaying the grant, in days. + * @return estimatedDays + **/ + @ApiModelProperty(required = true, value = "The estimated term for repaying the grant, in days.") + + public Integer getEstimatedDays() { + return estimatedDays; + } + + + public void setEstimatedDays(Integer estimatedDays) { + this.estimatedDays = estimatedDays; + } + + + public RepaymentTerm maximumDays(Integer maximumDays) { + + this.maximumDays = maximumDays; + return this; + } + + /** + * The maximum term for repaying the grant, in days. Only applies when `contractType` is **loan**. + * @return maximumDays + **/ + @ApiModelProperty(value = "The maximum term for repaying the grant, in days. Only applies when `contractType` is **loan**.") + + public Integer getMaximumDays() { + return maximumDays; + } + + + public void setMaximumDays(Integer maximumDays) { + this.maximumDays = maximumDays; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepaymentTerm repaymentTerm = (RepaymentTerm) o; + return Objects.equals(this.estimatedDays, repaymentTerm.estimatedDays) && + Objects.equals(this.maximumDays, repaymentTerm.maximumDays); + } + + @Override + public int hashCode() { + return Objects.hash(estimatedDays, maximumDays); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepaymentTerm {\n"); + sb.append(" estimatedDays: ").append(toIndentedString(estimatedDays)).append("\n"); + sb.append(" maximumDays: ").append(toIndentedString(maximumDays)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("estimatedDays"); + openapiFields.add("maximumDays"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("estimatedDays"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RepaymentTerm + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (RepaymentTerm.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in RepaymentTerm is not found in the empty JSON string", RepaymentTerm.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RepaymentTerm.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RepaymentTerm` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RepaymentTerm.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RepaymentTerm.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RepaymentTerm' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RepaymentTerm.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RepaymentTerm value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RepaymentTerm read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RepaymentTerm given an JSON string + * + * @param jsonString JSON string + * @return An instance of RepaymentTerm + * @throws IOException if the JSON string is invalid with respect to RepaymentTerm + */ + public static RepaymentTerm fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RepaymentTerm.class); + } + + /** + * Convert an instance of RepaymentTerm to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java b/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java index e918b1b76..911a41d6b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java +++ b/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java @@ -428,7 +428,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `invalidFields` (array) for (int i = 0; i < jsonArrayinvalidFields.size(); i++) { InvalidField.validateJsonObject(jsonArrayinvalidFields.get(i).getAsJsonObject()); - }; + } } // validate the optional field requestId if (jsonObj.get("requestId") != null && !jsonObj.get("requestId").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java b/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java new file mode 100644 index 000000000..333be404c --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java @@ -0,0 +1,217 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balanceplatform.Amount; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balanceplatform.JSON; + +/** + * ThresholdRepayment + */ + +public class ThresholdRepayment { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; + + public ThresholdRepayment() { + } + + public ThresholdRepayment amount(Amount amount) { + + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + **/ + @ApiModelProperty(required = true, value = "") + + public Amount getAmount() { + return amount; + } + + + public void setAmount(Amount amount) { + this.amount = amount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ThresholdRepayment thresholdRepayment = (ThresholdRepayment) o; + return Objects.equals(this.amount, thresholdRepayment.amount); + } + + @Override + public int hashCode() { + return Objects.hash(amount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ThresholdRepayment {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("amount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("amount"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ThresholdRepayment + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ThresholdRepayment.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ThresholdRepayment is not found in the empty JSON string", ThresholdRepayment.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ThresholdRepayment.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThresholdRepayment` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ThresholdRepayment.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ThresholdRepayment.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ThresholdRepayment' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ThresholdRepayment.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ThresholdRepayment value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ThresholdRepayment read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ThresholdRepayment given an JSON string + * + * @param jsonString JSON string + * @return An instance of ThresholdRepayment + * @throws IOException if the JSON string is invalid with respect to ThresholdRepayment + */ + public static ThresholdRepayment fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ThresholdRepayment.class); + } + + /** + * Convert an instance of ThresholdRepayment to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java index a14b508dc..0d36ae55f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `transactionRules` (array) for (int i = 0; i < jsonArraytransactionRules.size(); i++) { TransactionRule.validateJsonObject(jsonArraytransactionRules.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/binlookup/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/binlookup/AbstractOpenApiSchema.java index 5b8922732..c2bba329f 100644 --- a/src/main/java/com/adyen/model/binlookup/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/binlookup/AbstractOpenApiSchema.java @@ -1,7 +1,8 @@ /* * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * - * The version of the OpenAPI document: 52 + * The version of the OpenAPI document: 54 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/binlookup/Amount.java b/src/main/java/com/adyen/model/binlookup/Amount.java index 8e1ea6fac..be8768318 100644 --- a/src/main/java/com/adyen/model/binlookup/Amount.java +++ b/src/main/java/com/adyen/model/binlookup/Amount.java @@ -1,7 +1,8 @@ /* * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * - * The version of the OpenAPI document: 52 + * The version of the OpenAPI document: 54 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/binlookup/BinDetail.java b/src/main/java/com/adyen/model/binlookup/BinDetail.java index 60f636ed3..6d6ddcdaa 100644 --- a/src/main/java/com/adyen/model/binlookup/BinDetail.java +++ b/src/main/java/com/adyen/model/binlookup/BinDetail.java @@ -1,7 +1,8 @@ /* * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * - * The version of the OpenAPI document: 52 + * The version of the OpenAPI document: 54 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/binlookup/CardBin.java b/src/main/java/com/adyen/model/binlookup/CardBin.java index 24fd4e3d7..4afc40411 100644 --- a/src/main/java/com/adyen/model/binlookup/CardBin.java +++ b/src/main/java/com/adyen/model/binlookup/CardBin.java @@ -1,7 +1,8 @@ /* * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * - * The version of the OpenAPI document: 52 + * The version of the OpenAPI document: 54 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -64,6 +65,10 @@ public class CardBin { @SerializedName(SERIALIZED_NAME_FUNDS_AVAILABILITY) private String fundsAvailability; + public static final String SERIALIZED_NAME_ISSUER_BIN = "issuerBin"; + @SerializedName(SERIALIZED_NAME_ISSUER_BIN) + private String issuerBin; + public static final String SERIALIZED_NAME_ISSUING_BANK = "issuingBank"; @SerializedName(SERIALIZED_NAME_ISSUING_BANK) private String issuingBank; @@ -179,6 +184,28 @@ public void setFundsAvailability(String fundsAvailability) { } + public CardBin issuerBin(String issuerBin) { + + this.issuerBin = issuerBin; + return this; + } + + /** + * The first 8 digit of the card number. Enable this field via merchant account settings. + * @return issuerBin + **/ + @ApiModelProperty(value = "The first 8 digit of the card number. Enable this field via merchant account settings.") + + public String getIssuerBin() { + return issuerBin; + } + + + public void setIssuerBin(String issuerBin) { + this.issuerBin = issuerBin; + } + + public CardBin issuingBank(String issuingBank) { this.issuingBank = issuingBank; @@ -325,6 +352,7 @@ public boolean equals(Object o) { Objects.equals(this.commercial, cardBin.commercial) && Objects.equals(this.fundingSource, cardBin.fundingSource) && Objects.equals(this.fundsAvailability, cardBin.fundsAvailability) && + Objects.equals(this.issuerBin, cardBin.issuerBin) && Objects.equals(this.issuingBank, cardBin.issuingBank) && Objects.equals(this.issuingCountry, cardBin.issuingCountry) && Objects.equals(this.issuingCurrency, cardBin.issuingCurrency) && @@ -335,7 +363,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(bin, commercial, fundingSource, fundsAvailability, issuingBank, issuingCountry, issuingCurrency, paymentMethod, payoutEligible, summary); + return Objects.hash(bin, commercial, fundingSource, fundsAvailability, issuerBin, issuingBank, issuingCountry, issuingCurrency, paymentMethod, payoutEligible, summary); } @Override @@ -346,6 +374,7 @@ public String toString() { sb.append(" commercial: ").append(toIndentedString(commercial)).append("\n"); sb.append(" fundingSource: ").append(toIndentedString(fundingSource)).append("\n"); sb.append(" fundsAvailability: ").append(toIndentedString(fundsAvailability)).append("\n"); + sb.append(" issuerBin: ").append(toIndentedString(issuerBin)).append("\n"); sb.append(" issuingBank: ").append(toIndentedString(issuingBank)).append("\n"); sb.append(" issuingCountry: ").append(toIndentedString(issuingCountry)).append("\n"); sb.append(" issuingCurrency: ").append(toIndentedString(issuingCurrency)).append("\n"); @@ -378,6 +407,7 @@ private String toIndentedString(Object o) { openapiFields.add("commercial"); openapiFields.add("fundingSource"); openapiFields.add("fundsAvailability"); + openapiFields.add("issuerBin"); openapiFields.add("issuingBank"); openapiFields.add("issuingCountry"); openapiFields.add("issuingCurrency"); @@ -423,6 +453,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("fundsAvailability") != null && !jsonObj.get("fundsAvailability").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `fundsAvailability` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fundsAvailability").toString())); } + // validate the optional field issuerBin + if (jsonObj.get("issuerBin") != null && !jsonObj.get("issuerBin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `issuerBin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerBin").toString())); + } // validate the optional field issuingBank if (jsonObj.get("issuingBank") != null && !jsonObj.get("issuingBank").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `issuingBank` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuingBank").toString())); diff --git a/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java b/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java index 6926592aa..bb85e478d 100644 --- a/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java +++ b/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java @@ -1,7 +1,8 @@ /* * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * - * The version of the OpenAPI document: 52 + * The version of the OpenAPI document: 54 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java b/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java index 969a761c7..c672770e1 100644 --- a/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java +++ b/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java @@ -1,7 +1,8 @@ /* * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * - * The version of the OpenAPI document: 52 + * The version of the OpenAPI document: 54 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java b/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java index 893005dbf..fa3d9399c 100644 --- a/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java +++ b/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java @@ -1,7 +1,8 @@ /* * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * - * The version of the OpenAPI document: 52 + * The version of the OpenAPI document: 54 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java b/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java index 9e30676d3..31b694d31 100644 --- a/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java +++ b/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java @@ -1,7 +1,8 @@ /* * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * - * The version of the OpenAPI document: 52 + * The version of the OpenAPI document: 54 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/binlookup/JSON.java b/src/main/java/com/adyen/model/binlookup/JSON.java index 3e5c86c4d..49e16ece0 100644 --- a/src/main/java/com/adyen/model/binlookup/JSON.java +++ b/src/main/java/com/adyen/model/binlookup/JSON.java @@ -1,7 +1,8 @@ /* * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * - * The version of the OpenAPI document: 52 + * The version of the OpenAPI document: 54 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/binlookup/MerchantDetails.java b/src/main/java/com/adyen/model/binlookup/MerchantDetails.java index 6b582b908..945a1b71d 100644 --- a/src/main/java/com/adyen/model/binlookup/MerchantDetails.java +++ b/src/main/java/com/adyen/model/binlookup/MerchantDetails.java @@ -1,7 +1,8 @@ /* * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * - * The version of the OpenAPI document: 52 + * The version of the OpenAPI document: 54 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/binlookup/Recurring.java b/src/main/java/com/adyen/model/binlookup/Recurring.java index dd0144c9e..ac875d701 100644 --- a/src/main/java/com/adyen/model/binlookup/Recurring.java +++ b/src/main/java/com/adyen/model/binlookup/Recurring.java @@ -1,7 +1,8 @@ /* * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * - * The version of the OpenAPI document: 52 + * The version of the OpenAPI document: 54 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/binlookup/ServiceError.java b/src/main/java/com/adyen/model/binlookup/ServiceError.java index a4390feb3..a7286353d 100644 --- a/src/main/java/com/adyen/model/binlookup/ServiceError.java +++ b/src/main/java/com/adyen/model/binlookup/ServiceError.java @@ -1,7 +1,8 @@ /* * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * - * The version of the OpenAPI document: 52 + * The version of the OpenAPI document: 54 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/binlookup/ThreeDS2CardRangeDetail.java b/src/main/java/com/adyen/model/binlookup/ThreeDS2CardRangeDetail.java index 0b9227c76..2a3979a09 100644 --- a/src/main/java/com/adyen/model/binlookup/ThreeDS2CardRangeDetail.java +++ b/src/main/java/com/adyen/model/binlookup/ThreeDS2CardRangeDetail.java @@ -1,7 +1,8 @@ /* * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * - * The version of the OpenAPI document: 52 + * The version of the OpenAPI document: 54 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -66,9 +67,9 @@ public class ThreeDS2CardRangeDetail { @SerializedName(SERIALIZED_NAME_START_RANGE) private String startRange; - public static final String SERIALIZED_NAME_THREE_D_S2_VERSION = "threeDS2Version"; - @SerializedName(SERIALIZED_NAME_THREE_D_S2_VERSION) - private String threeDS2Version; + public static final String SERIALIZED_NAME_THREE_D_S2_VERSIONS = "threeDS2Versions"; + @SerializedName(SERIALIZED_NAME_THREE_D_S2_VERSIONS) + private List threeDS2Versions = null; public static final String SERIALIZED_NAME_THREE_D_S_METHOD_U_R_L = "threeDSMethodURL"; @SerializedName(SERIALIZED_NAME_THREE_D_S_METHOD_U_R_L) @@ -173,25 +174,33 @@ public void setStartRange(String startRange) { } - public ThreeDS2CardRangeDetail threeDS2Version(String threeDS2Version) { + public ThreeDS2CardRangeDetail threeDS2Versions(List threeDS2Versions) { - this.threeDS2Version = threeDS2Version; + this.threeDS2Versions = threeDS2Versions; + return this; + } + + public ThreeDS2CardRangeDetail addThreeDS2VersionsItem(String threeDS2VersionsItem) { + if (this.threeDS2Versions == null) { + this.threeDS2Versions = new ArrayList<>(); + } + this.threeDS2Versions.add(threeDS2VersionsItem); return this; } /** - * 3D Secure protocol version. - * @return threeDS2Version + * Supported 3D Secure protocol versions + * @return threeDS2Versions **/ - @ApiModelProperty(value = "3D Secure protocol version.") + @ApiModelProperty(value = "Supported 3D Secure protocol versions") - public String getThreeDS2Version() { - return threeDS2Version; + public List getThreeDS2Versions() { + return threeDS2Versions; } - public void setThreeDS2Version(String threeDS2Version) { - this.threeDS2Version = threeDS2Version; + public void setThreeDS2Versions(List threeDS2Versions) { + this.threeDS2Versions = threeDS2Versions; } @@ -231,13 +240,13 @@ public boolean equals(Object o) { Objects.equals(this.brandCode, threeDS2CardRangeDetail.brandCode) && Objects.equals(this.endRange, threeDS2CardRangeDetail.endRange) && Objects.equals(this.startRange, threeDS2CardRangeDetail.startRange) && - Objects.equals(this.threeDS2Version, threeDS2CardRangeDetail.threeDS2Version) && + Objects.equals(this.threeDS2Versions, threeDS2CardRangeDetail.threeDS2Versions) && Objects.equals(this.threeDSMethodURL, threeDS2CardRangeDetail.threeDSMethodURL); } @Override public int hashCode() { - return Objects.hash(acsInfoInd, brandCode, endRange, startRange, threeDS2Version, threeDSMethodURL); + return Objects.hash(acsInfoInd, brandCode, endRange, startRange, threeDS2Versions, threeDSMethodURL); } @Override @@ -248,7 +257,7 @@ public String toString() { sb.append(" brandCode: ").append(toIndentedString(brandCode)).append("\n"); sb.append(" endRange: ").append(toIndentedString(endRange)).append("\n"); sb.append(" startRange: ").append(toIndentedString(startRange)).append("\n"); - sb.append(" threeDS2Version: ").append(toIndentedString(threeDS2Version)).append("\n"); + sb.append(" threeDS2Versions: ").append(toIndentedString(threeDS2Versions)).append("\n"); sb.append(" threeDSMethodURL: ").append(toIndentedString(threeDSMethodURL)).append("\n"); sb.append("}"); return sb.toString(); @@ -276,7 +285,7 @@ private String toIndentedString(Object o) { openapiFields.add("brandCode"); openapiFields.add("endRange"); openapiFields.add("startRange"); - openapiFields.add("threeDS2Version"); + openapiFields.add("threeDS2Versions"); openapiFields.add("threeDSMethodURL"); // a set of required properties/fields (JSON key names) @@ -321,9 +330,9 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("startRange") != null && !jsonObj.get("startRange").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `startRange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startRange").toString())); } - // validate the optional field threeDS2Version - if (jsonObj.get("threeDS2Version") != null && !jsonObj.get("threeDS2Version").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDS2Version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDS2Version").toString())); + // ensure the json data is an array + if (jsonObj.get("threeDS2Versions") != null && !jsonObj.get("threeDS2Versions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `threeDS2Versions` to be an array in the JSON string but got `%s`", jsonObj.get("threeDS2Versions").toString())); } // validate the optional field threeDSMethodURL if (jsonObj.get("threeDSMethodURL") != null && !jsonObj.get("threeDSMethodURL").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java index b7a642551..1cf6f36b8 100644 --- a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java +++ b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java @@ -1,7 +1,8 @@ /* * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * - * The version of the OpenAPI document: 52 + * The version of the OpenAPI document: 54 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java index 5ef1ff083..76623d94c 100644 --- a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java +++ b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java @@ -1,7 +1,8 @@ /* * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * - * The version of the OpenAPI document: 52 + * The version of the OpenAPI document: 54 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -301,7 +302,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `dsPublicKeys` (array) for (int i = 0; i < jsonArraydsPublicKeys.size(); i++) { DSPublicKeyDetail.validateJsonObject(jsonArraydsPublicKeys.get(i).getAsJsonObject()); - }; + } } JsonArray jsonArraythreeDS2CardRangeDetails = jsonObj.getAsJsonArray("threeDS2CardRangeDetails"); if (jsonArraythreeDS2CardRangeDetails != null) { @@ -313,7 +314,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `threeDS2CardRangeDetails` (array) for (int i = 0; i < jsonArraythreeDS2CardRangeDetails.size(); i++) { ThreeDS2CardRangeDetail.validateJsonObject(jsonArraythreeDS2CardRangeDetails.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataAirline.java b/src/main/java/com/adyen/model/checkout/AdditionalDataAirline.java index a54e1536c..d9116d98b 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataAirline.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataAirline.java @@ -170,10 +170,10 @@ public AdditionalDataAirline airlineAgencyInvoiceNumber(String airlineAgencyInvo } /** - * Reference number for the invoice, issued by the agency. * minLength: 1 * maxLength: 6 + * The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters * @return airlineAgencyInvoiceNumber **/ - @ApiModelProperty(value = "Reference number for the invoice, issued by the agency. * minLength: 1 * maxLength: 6") + @ApiModelProperty(value = "The reference number for the invoice, issued by the agency. * Encoding: ASCII * minLength: 1 character * maxLength: 6 characters") public String getAirlineAgencyInvoiceNumber() { return airlineAgencyInvoiceNumber; @@ -192,10 +192,10 @@ public AdditionalDataAirline airlineAgencyPlanName(String airlineAgencyPlanName) } /** - * 2-letter agency plan identifier; alphabetical. * minLength: 2 * maxLength: 2 + * The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters * @return airlineAgencyPlanName **/ - @ApiModelProperty(value = "2-letter agency plan identifier; alphabetical. * minLength: 2 * maxLength: 2") + @ApiModelProperty(value = "The two-letter agency plan identifier. * Encoding: ASCII * minLength: 2 characters * maxLength: 2 characters") public String getAirlineAgencyPlanName() { return airlineAgencyPlanName; @@ -214,10 +214,10 @@ public AdditionalDataAirline airlineAirlineCode(String airlineAirlineCode) { } /** - * [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX); numeric. It identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 * maxLength: 3 + * The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros * @return airlineAirlineCode **/ - @ApiModelProperty(value = "[IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX); numeric. It identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 * maxLength: 3") + @ApiModelProperty(value = "The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros") public String getAirlineAirlineCode() { return airlineAirlineCode; @@ -236,10 +236,10 @@ public AdditionalDataAirline airlineAirlineDesignatorCode(String airlineAirlineD } /** - * [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 + * The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros * @return airlineAirlineDesignatorCode **/ - @ApiModelProperty(value = "[IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2") + @ApiModelProperty(value = "The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros") public String getAirlineAirlineDesignatorCode() { return airlineAirlineDesignatorCode; @@ -258,10 +258,10 @@ public AdditionalDataAirline airlineBoardingFee(String airlineBoardingFee) { } /** - * Chargeable amount for boarding the plane. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 18 + * The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters * @return airlineBoardingFee **/ - @ApiModelProperty(value = "Chargeable amount for boarding the plane. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 18") + @ApiModelProperty(value = "The amount charged for boarding the plane, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 character * maxLength: 18 characters") public String getAirlineBoardingFee() { return airlineBoardingFee; @@ -280,10 +280,10 @@ public AdditionalDataAirline airlineComputerizedReservationSystem(String airline } /** - * The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Format: alphanumeric. * minLength: 4 * maxLength: 4 + * The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters * @return airlineComputerizedReservationSystem **/ - @ApiModelProperty(value = "The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Format: alphanumeric. * minLength: 4 * maxLength: 4") + @ApiModelProperty(value = "The [CRS](https://en.wikipedia.org/wiki/Computer_reservation_system) used to make the reservation and purchase the ticket. * Encoding: ASCII * minLength: 4 characters * maxLength: 4 characters") public String getAirlineComputerizedReservationSystem() { return airlineComputerizedReservationSystem; @@ -302,10 +302,10 @@ public AdditionalDataAirline airlineCustomerReferenceNumber(String airlineCustom } /** - * Reference number; alphanumeric. * minLength: 0 * maxLength: 20 + * The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces * @return airlineCustomerReferenceNumber **/ - @ApiModelProperty(value = "Reference number; alphanumeric. * minLength: 0 * maxLength: 20") + @ApiModelProperty(value = "The alphanumeric customer reference number. * Encoding: ASCII * maxLength: 20 characters * If you send more than 20 characters, the customer reference number is truncated * Must not be all spaces") public String getAirlineCustomerReferenceNumber() { return airlineCustomerReferenceNumber; @@ -324,10 +324,10 @@ public AdditionalDataAirline airlineDocumentType(String airlineDocumentType) { } /** - * Optional 2-digit code; alphanumeric. It identifies the type of product of the transaction. The description of the code may appear on credit card statements. * Format: 2-digit code * Example: Passenger ticket = 01 * minLength: 2 * maxLength: 2 + * A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters * @return airlineDocumentType **/ - @ApiModelProperty(value = "Optional 2-digit code; alphanumeric. It identifies the type of product of the transaction. The description of the code may appear on credit card statements. * Format: 2-digit code * Example: Passenger ticket = 01 * minLength: 2 * maxLength: 2") + @ApiModelProperty(value = "A code that identifies the type of item bought. The description of the code can appear on credit card statements. * Encoding: ASCII * Example: Passenger ticket = 01 * minLength: 2 characters * maxLength: 2 characters") public String getAirlineDocumentType() { return airlineDocumentType; @@ -346,10 +346,10 @@ public AdditionalDataAirline airlineFlightDate(String airlineFlightDate) { } /** - * Flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 * maxLength: 16 + * The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters * @return airlineFlightDate **/ - @ApiModelProperty(value = "Flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 * maxLength: 16") + @ApiModelProperty(value = "The flight departure date. Local time `(HH:mm)` is optional. * Date format: `yyyy-MM-dd` * Date and time format: `yyyy-MM-dd HH:mm` * minLength: 10 characters * maxLength: 16 characters") public String getAirlineFlightDate() { return airlineFlightDate; @@ -368,10 +368,10 @@ public AdditionalDataAirline airlineLegCarrierCode(String airlineLegCarrierCode) } /** - * [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. This field is required/mandatory if the airline data includes leg details. * Format: IATA 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2 + * The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros * @return airlineLegCarrierCode **/ - @ApiModelProperty(value = "[IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX); alphabetical. It identifies the carrier. This field is required/mandatory if the airline data includes leg details. * Format: IATA 2-letter airline code * Example: KLM = KL * minLength: 2 * maxLength: 2") + @ApiModelProperty(value = "The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros") public String getAirlineLegCarrierCode() { return airlineLegCarrierCode; @@ -390,10 +390,10 @@ public AdditionalDataAirline airlineLegClassOfTravel(String airlineLegClassOfTra } /** - * 1-letter travel class identifier; alphabetical. There is no standard; however, the following codes are used rather consistently: * F: first class * J: business class * Y: economy class * W: premium economy Limitations: * minLength: 1 * maxLength: 1 + * A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros * @return airlineLegClassOfTravel **/ - @ApiModelProperty(value = "1-letter travel class identifier; alphabetical. There is no standard; however, the following codes are used rather consistently: * F: first class * J: business class * Y: economy class * W: premium economy Limitations: * minLength: 1 * maxLength: 1") + @ApiModelProperty(value = "A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros") public String getAirlineLegClassOfTravel() { return airlineLegClassOfTravel; @@ -412,10 +412,10 @@ public AdditionalDataAirline airlineLegDateOfTravel(String airlineLegDateOfTrave } /** - * Date and time of travel. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-compliant. * Format: `yyyy-MM-dd HH:mm` * minLength: 16 * maxLength: 16 + * Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters * @return airlineLegDateOfTravel **/ - @ApiModelProperty(value = " Date and time of travel. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-compliant. * Format: `yyyy-MM-dd HH:mm` * minLength: 16 * maxLength: 16") + @ApiModelProperty(value = " Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters") public String getAirlineLegDateOfTravel() { return airlineLegDateOfTravel; @@ -434,10 +434,10 @@ public AdditionalDataAirline airlineLegDepartAirport(String airlineLegDepartAirp } /** - * Alphabetical identifier of the departure airport. This field is required if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 + * The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros * @return airlineLegDepartAirport **/ - @ApiModelProperty(value = "Alphabetical identifier of the departure airport. This field is required if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3") + @ApiModelProperty(value = "The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros") public String getAirlineLegDepartAirport() { return airlineLegDepartAirport; @@ -456,10 +456,10 @@ public AdditionalDataAirline airlineLegDepartTax(String airlineLegDepartTax) { } /** - * [Departure tax](https://en.wikipedia.org/wiki/Departure_tax). Amount charged by a country to an individual upon their leaving. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 12 + * The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros * @return airlineLegDepartTax **/ - @ApiModelProperty(value = "[Departure tax](https://en.wikipedia.org/wiki/Departure_tax). Amount charged by a country to an individual upon their leaving. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). * minLength: 1 * maxLength: 12") + @ApiModelProperty(value = "The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros") public String getAirlineLegDepartTax() { return airlineLegDepartTax; @@ -478,10 +478,10 @@ public AdditionalDataAirline airlineLegDestinationCode(String airlineLegDestinat } /** - * Alphabetical identifier of the destination/arrival airport. This field is required/mandatory if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3 + * The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros * @return airlineLegDestinationCode **/ - @ApiModelProperty(value = "Alphabetical identifier of the destination/arrival airport. This field is required/mandatory if the airline data includes leg details. * Format: [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code. * Example: Amsterdam = AMS * minLength: 3 * maxLength: 3") + @ApiModelProperty(value = "The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros") public String getAirlineLegDestinationCode() { return airlineLegDestinationCode; @@ -500,10 +500,10 @@ public AdditionalDataAirline airlineLegFareBaseCode(String airlineLegFareBaseCod } /** - * [Fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code); alphanumeric. * minLength: 1 * maxLength: 7 + * The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros * @return airlineLegFareBaseCode **/ - @ApiModelProperty(value = "[Fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code); alphanumeric. * minLength: 1 * maxLength: 7") + @ApiModelProperty(value = "The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros") public String getAirlineLegFareBaseCode() { return airlineLegFareBaseCode; @@ -522,10 +522,10 @@ public AdditionalDataAirline airlineLegFlightNumber(String airlineLegFlightNumbe } /** - * The flight identifier. * minLength: 1 * maxLength: 5 + * The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros * @return airlineLegFlightNumber **/ - @ApiModelProperty(value = "The flight identifier. * minLength: 1 * maxLength: 5") + @ApiModelProperty(value = "The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros") public String getAirlineLegFlightNumber() { return airlineLegFlightNumber; @@ -544,10 +544,10 @@ public AdditionalDataAirline airlineLegStopOverCode(String airlineLegStopOverCod } /** - * 1-letter code that indicates whether the passenger is entitled to make a stopover. Only two types of characters are allowed: * O: Stopover allowed * X: Stopover not allowed Limitations: * minLength: 1 * maxLength: 1 + * A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * @return airlineLegStopOverCode **/ - @ApiModelProperty(value = "1-letter code that indicates whether the passenger is entitled to make a stopover. Only two types of characters are allowed: * O: Stopover allowed * X: Stopover not allowed Limitations: * minLength: 1 * maxLength: 1") + @ApiModelProperty(value = "A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character") public String getAirlineLegStopOverCode() { return airlineLegStopOverCode; @@ -566,10 +566,10 @@ public AdditionalDataAirline airlinePassengerDateOfBirth(String airlinePassenger } /** - * Date of birth of the passenger. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 + * The passenger's date of birth. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10 * @return airlinePassengerDateOfBirth **/ - @ApiModelProperty(value = "Date of birth of the passenger. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10") + @ApiModelProperty(value = "The passenger's date of birth. Date format: `yyyy-MM-dd` * minLength: 10 * maxLength: 10") public String getAirlinePassengerDateOfBirth() { return airlinePassengerDateOfBirth; @@ -588,10 +588,10 @@ public AdditionalDataAirline airlinePassengerFirstName(String airlinePassengerFi } /** - * Passenger first name/given name. > This field is required/mandatory if the airline data includes passenger details or leg details. + * The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII * @return airlinePassengerFirstName **/ - @ApiModelProperty(value = "Passenger first name/given name. > This field is required/mandatory if the airline data includes passenger details or leg details.") + @ApiModelProperty(value = "The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII") public String getAirlinePassengerFirstName() { return airlinePassengerFirstName; @@ -610,10 +610,10 @@ public AdditionalDataAirline airlinePassengerLastName(String airlinePassengerLas } /** - * Passenger last name/family name. > This field is required/mandatory if the airline data includes passenger details or leg details. + * The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII * @return airlinePassengerLastName **/ - @ApiModelProperty(value = "Passenger last name/family name. > This field is required/mandatory if the airline data includes passenger details or leg details.") + @ApiModelProperty(value = "The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII") public String getAirlinePassengerLastName() { return airlinePassengerLastName; @@ -632,10 +632,10 @@ public AdditionalDataAirline airlinePassengerTelephoneNumber(String airlinePasse } /** - * Telephone number of the passenger, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * minLength: 3 * maxLength: 30 + * The passenger's telephone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters * @return airlinePassengerTelephoneNumber **/ - @ApiModelProperty(value = "Telephone number of the passenger, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * minLength: 3 * maxLength: 30") + @ApiModelProperty(value = "The passenger's telephone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters") public String getAirlinePassengerTelephoneNumber() { return airlinePassengerTelephoneNumber; @@ -654,10 +654,10 @@ public AdditionalDataAirline airlinePassengerTravellerType(String airlinePasseng } /** - * Passenger type code (PTC). IATA PTC values are 3-letter alphabetical. Example: ADT, SRC, CNN, INS. However, several carriers use non-standard codes that can be up to 5 alphanumeric characters. * minLength: 3 * maxLength: 6 + * The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters * @return airlinePassengerTravellerType **/ - @ApiModelProperty(value = "Passenger type code (PTC). IATA PTC values are 3-letter alphabetical. Example: ADT, SRC, CNN, INS. However, several carriers use non-standard codes that can be up to 5 alphanumeric characters. * minLength: 3 * maxLength: 6") + @ApiModelProperty(value = "The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters") public String getAirlinePassengerTravellerType() { return airlinePassengerTravellerType; @@ -676,10 +676,10 @@ public AdditionalDataAirline airlinePassengerName(String airlinePassengerName) { } /** - * Passenger name, initials, and a title. * Format: last name + first name or initials + title. * Example: *FLYER / MARY MS*. * minLength: 1 * maxLength: 49 + * The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros * @return airlinePassengerName **/ - @ApiModelProperty(required = true, value = "Passenger name, initials, and a title. * Format: last name + first name or initials + title. * Example: *FLYER / MARY MS*. * minLength: 1 * maxLength: 49") + @ApiModelProperty(required = true, value = "The passenger's name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros") public String getAirlinePassengerName() { return airlinePassengerName; @@ -698,10 +698,10 @@ public AdditionalDataAirline airlineTicketIssueAddress(String airlineTicketIssue } /** - * Address of the place/agency that issued the ticket. * minLength: 0 * maxLength: 16 + * The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters * @return airlineTicketIssueAddress **/ - @ApiModelProperty(value = "Address of the place/agency that issued the ticket. * minLength: 0 * maxLength: 16") + @ApiModelProperty(value = "The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters") public String getAirlineTicketIssueAddress() { return airlineTicketIssueAddress; @@ -720,10 +720,10 @@ public AdditionalDataAirline airlineTicketNumber(String airlineTicketNumber) { } /** - * The ticket's unique identifier. * minLength: 1 * maxLength: 150 + * The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros * @return airlineTicketNumber **/ - @ApiModelProperty(value = "The ticket's unique identifier. * minLength: 1 * maxLength: 150") + @ApiModelProperty(value = "The ticket's unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros") public String getAirlineTicketNumber() { return airlineTicketNumber; @@ -742,10 +742,10 @@ public AdditionalDataAirline airlineTravelAgencyCode(String airlineTravelAgencyC } /** - * IATA number, also ARC number or ARC/IATA number. Unique identifier number for travel agencies. * minLength: 1 * maxLength: 8 + * The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros * @return airlineTravelAgencyCode **/ - @ApiModelProperty(value = "IATA number, also ARC number or ARC/IATA number. Unique identifier number for travel agencies. * minLength: 1 * maxLength: 8") + @ApiModelProperty(value = "The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros") public String getAirlineTravelAgencyCode() { return airlineTravelAgencyCode; @@ -764,10 +764,10 @@ public AdditionalDataAirline airlineTravelAgencyName(String airlineTravelAgencyN } /** - * The name of the travel agency. * minLength: 1 * maxLength: 25 + * The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros * @return airlineTravelAgencyName **/ - @ApiModelProperty(value = "The name of the travel agency. * minLength: 1 * maxLength: 25") + @ApiModelProperty(value = "The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros") public String getAirlineTravelAgencyName() { return airlineTravelAgencyName; diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataCarRental.java b/src/main/java/com/adyen/model/checkout/AdditionalDataCarRental.java index c66484f2e..2459aa630 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataCarRental.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataCarRental.java @@ -150,10 +150,10 @@ public AdditionalDataCarRental carRentalCheckOutDate(String carRentalCheckOutDat } /** - * Pick-up date. * Date format: `yyyyMMdd` + * The pick-up date. * Date format: `yyyyMMdd` * @return carRentalCheckOutDate **/ - @ApiModelProperty(value = "Pick-up date. * Date format: `yyyyMMdd`") + @ApiModelProperty(value = "The pick-up date. * Date format: `yyyyMMdd`") public String getCarRentalCheckOutDate() { return carRentalCheckOutDate; @@ -172,10 +172,10 @@ public AdditionalDataCarRental carRentalCustomerServiceTollFreeNumber(String car } /** - * The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 + * The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - * @return carRentalCustomerServiceTollFreeNumber **/ - @ApiModelProperty(value = "The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17") + @ApiModelProperty(value = "The customer service phone number of the car rental company. * Format: Alphanumeric * maxLength: 17 * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or -") public String getCarRentalCustomerServiceTollFreeNumber() { return carRentalCustomerServiceTollFreeNumber; @@ -194,10 +194,10 @@ public AdditionalDataCarRental carRentalDaysRented(String carRentalDaysRented) { } /** - * Number of days for which the car is being rented. * Format: Numeric * maxLength: 19 + * Number of days for which the car is being rented. * Format: Numeric * maxLength: 2 * Must not be all spaces * @return carRentalDaysRented **/ - @ApiModelProperty(value = "Number of days for which the car is being rented. * Format: Numeric * maxLength: 19") + @ApiModelProperty(value = "Number of days for which the car is being rented. * Format: Numeric * maxLength: 2 * Must not be all spaces") public String getCarRentalDaysRented() { return carRentalDaysRented; @@ -216,10 +216,10 @@ public AdditionalDataCarRental carRentalFuelCharges(String carRentalFuelCharges) } /** - * Any fuel charges associated with the rental. * Format: Numeric * maxLength: 12 + * Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * @return carRentalFuelCharges **/ - @ApiModelProperty(value = "Any fuel charges associated with the rental. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "Any fuel charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12") public String getCarRentalFuelCharges() { return carRentalFuelCharges; @@ -238,10 +238,10 @@ public AdditionalDataCarRental carRentalInsuranceCharges(String carRentalInsuran } /** - * Any insurance charges associated with the rental. * Format: Numeric * maxLength: 12 + * Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces * Must not be all zeros * @return carRentalInsuranceCharges **/ - @ApiModelProperty(value = "Any insurance charges associated with the rental. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "Any insurance charges associated with the rental, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Numeric * maxLength: 12 * Must not be all spaces * Must not be all zeros") public String getCarRentalInsuranceCharges() { return carRentalInsuranceCharges; @@ -260,10 +260,10 @@ public AdditionalDataCarRental carRentalLocationCity(String carRentalLocationCit } /** - * The city from which the car is rented. * Format: Alphanumeric * maxLength: 18 + * The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros * @return carRentalLocationCity **/ - @ApiModelProperty(value = "The city from which the car is rented. * Format: Alphanumeric * maxLength: 18") + @ApiModelProperty(value = "The city where the car is rented. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros") public String getCarRentalLocationCity() { return carRentalLocationCity; @@ -282,10 +282,10 @@ public AdditionalDataCarRental carRentalLocationCountry(String carRentalLocation } /** - * The country from which the car is rented. * Format: Alphanumeric * maxLength: 2 + * The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 * @return carRentalLocationCountry **/ - @ApiModelProperty(value = "The country from which the car is rented. * Format: Alphanumeric * maxLength: 2") + @ApiModelProperty(value = "The country where the car is rented, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2") public String getCarRentalLocationCountry() { return carRentalLocationCountry; @@ -304,10 +304,10 @@ public AdditionalDataCarRental carRentalLocationStateProvince(String carRentalLo } /** - * The state or province from where the car is rented. * Format: Alphanumeric * maxLength: 3 + * The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces * Must not be all zeros * @return carRentalLocationStateProvince **/ - @ApiModelProperty(value = "The state or province from where the car is rented. * Format: Alphanumeric * maxLength: 3") + @ApiModelProperty(value = "The state or province where the car is rented. * Format: Alphanumeric * maxLength: 2 * Must not start with a space or be all spaces * Must not be all zeros") public String getCarRentalLocationStateProvince() { return carRentalLocationStateProvince; @@ -326,10 +326,10 @@ public AdditionalDataCarRental carRentalNoShowIndicator(String carRentalNoShowIn } /** - * Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). * Y - Customer was a no show. * N - Not applicable. + * Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable * @return carRentalNoShowIndicator **/ - @ApiModelProperty(value = "Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). * Y - Customer was a no show. * N - Not applicable.") + @ApiModelProperty(value = "Indicates if the customer didn't pick up their rental car. * Y - Customer did not pick up their car * N - Not applicable") public String getCarRentalNoShowIndicator() { return carRentalNoShowIndicator; @@ -348,10 +348,10 @@ public AdditionalDataCarRental carRentalOneWayDropOffCharges(String carRentalOne } /** - * Charge associated with not returning a vehicle to the original rental location. + * The charge for not returning a car to the original rental location, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 12 * @return carRentalOneWayDropOffCharges **/ - @ApiModelProperty(value = "Charge associated with not returning a vehicle to the original rental location.") + @ApiModelProperty(value = "The charge for not returning a car to the original rental location, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 12") public String getCarRentalOneWayDropOffCharges() { return carRentalOneWayDropOffCharges; @@ -370,10 +370,10 @@ public AdditionalDataCarRental carRentalRate(String carRentalRate) { } /** - * Daily rental rate. * Format: Alphanumeric * maxLength: 12 + * The daily rental rate, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Alphanumeric * maxLength: 12 * @return carRentalRate **/ - @ApiModelProperty(value = "Daily rental rate. * Format: Alphanumeric * maxLength: 12") + @ApiModelProperty(value = "The daily rental rate, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: Alphanumeric * maxLength: 12") public String getCarRentalRate() { return carRentalRate; @@ -392,10 +392,10 @@ public AdditionalDataCarRental carRentalRateIndicator(String carRentalRateIndica } /** - * Specifies whether the given rate is applied daily or weekly. * D - Daily rate. * W - Weekly rate. + * Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate * @return carRentalRateIndicator **/ - @ApiModelProperty(value = "Specifies whether the given rate is applied daily or weekly. * D - Daily rate. * W - Weekly rate.") + @ApiModelProperty(value = "Specifies whether the given rate is applied daily or weekly. * D - Daily rate * W - Weekly rate") public String getCarRentalRateIndicator() { return carRentalRateIndicator; @@ -414,10 +414,10 @@ public AdditionalDataCarRental carRentalRentalAgreementNumber(String carRentalRe } /** - * The rental agreement number associated with this car rental. * Format: Alphanumeric * maxLength: 9 + * The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces * Must not be all zeros * @return carRentalRentalAgreementNumber **/ - @ApiModelProperty(value = "The rental agreement number associated with this car rental. * Format: Alphanumeric * maxLength: 9") + @ApiModelProperty(value = "The rental agreement number for the car rental. * Format: Alphanumeric * maxLength: 9 * Must not start with a space or be all spaces * Must not be all zeros") public String getCarRentalRentalAgreementNumber() { return carRentalRentalAgreementNumber; @@ -436,10 +436,10 @@ public AdditionalDataCarRental carRentalRentalClassId(String carRentalRentalClas } /** - * Daily rental rate. * Format: Alphanumeric * maxLength: 12 + * The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces * Must not be all zeros * @return carRentalRentalClassId **/ - @ApiModelProperty(value = "Daily rental rate. * Format: Alphanumeric * maxLength: 12") + @ApiModelProperty(value = "The classification of the rental car. * Format: Alphanumeric * maxLength: 4 * Must not start with a space or be all spaces * Must not be all zeros") public String getCarRentalRentalClassId() { return carRentalRentalClassId; @@ -458,10 +458,10 @@ public AdditionalDataCarRental carRentalRenterName(String carRentalRenterName) { } /** - * The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 + * The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces * Must not be all zeros * @return carRentalRenterName **/ - @ApiModelProperty(value = "The name of the person renting the car. * Format: Alphanumeric * maxLength: 26") + @ApiModelProperty(value = "The name of the person renting the car. * Format: Alphanumeric * maxLength: 26 * If you send more than 26 characters, the name is truncated * Must not start with a space or be all spaces * Must not be all zeros") public String getCarRentalRenterName() { return carRentalRenterName; @@ -480,10 +480,10 @@ public AdditionalDataCarRental carRentalReturnCity(String carRentalReturnCity) { } /** - * The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 + * The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros * @return carRentalReturnCity **/ - @ApiModelProperty(value = "The city where the car must be returned. * Format: Alphanumeric * maxLength: 18") + @ApiModelProperty(value = "The city where the car must be returned. * Format: Alphanumeric * maxLength: 18 * Must not start with a space or be all spaces * Must not be all zeros") public String getCarRentalReturnCity() { return carRentalReturnCity; @@ -502,10 +502,10 @@ public AdditionalDataCarRental carRentalReturnCountry(String carRentalReturnCoun } /** - * The country where the car must be returned. * Format: Alphanumeric * maxLength: 2 + * The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2 * @return carRentalReturnCountry **/ - @ApiModelProperty(value = "The country where the car must be returned. * Format: Alphanumeric * maxLength: 2") + @ApiModelProperty(value = "The country where the car must be returned, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * Format: Alphanumeric * maxLength: 2") public String getCarRentalReturnCountry() { return carRentalReturnCountry; @@ -524,10 +524,10 @@ public AdditionalDataCarRental carRentalReturnDate(String carRentalReturnDate) { } /** - * The last date to return the car by. * Date format: `yyyyMMdd` + * The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8 * @return carRentalReturnDate **/ - @ApiModelProperty(value = "The last date to return the car by. * Date format: `yyyyMMdd`") + @ApiModelProperty(value = "The last date to return the car by. * Date format: `yyyyMMdd` * maxLength: 8") public String getCarRentalReturnDate() { return carRentalReturnDate; @@ -546,10 +546,10 @@ public AdditionalDataCarRental carRentalReturnLocationId(String carRentalReturnL } /** - * Agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 + * The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces * Must not be all zeros * @return carRentalReturnLocationId **/ - @ApiModelProperty(value = "Agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10") + @ApiModelProperty(value = "The agency code, phone number, or address abbreviation * Format: Alphanumeric * maxLength: 10 * Must not start with a space or be all spaces * Must not be all zeros") public String getCarRentalReturnLocationId() { return carRentalReturnLocationId; @@ -568,10 +568,10 @@ public AdditionalDataCarRental carRentalReturnStateProvince(String carRentalRetu } /** - * The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 + * The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces * Must not be all zeros * @return carRentalReturnStateProvince **/ - @ApiModelProperty(value = "The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3") + @ApiModelProperty(value = "The state or province where the car must be returned. * Format: Alphanumeric * maxLength: 3 * Must not start with a space or be all spaces * Must not be all zeros") public String getCarRentalReturnStateProvince() { return carRentalReturnStateProvince; @@ -590,10 +590,10 @@ public AdditionalDataCarRental carRentalTaxExemptIndicator(String carRentalTaxEx } /** - * Indicates whether the goods or services were tax-exempt, or tax was not collected. Values: * Y - Goods or services were tax exempt * N - Tax was not collected + * Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected * @return carRentalTaxExemptIndicator **/ - @ApiModelProperty(value = "Indicates whether the goods or services were tax-exempt, or tax was not collected. Values: * Y - Goods or services were tax exempt * N - Tax was not collected") + @ApiModelProperty(value = "Indicates if the goods or services were tax-exempt, or if tax was not paid on them. Values: * Y - Goods or services were tax exempt * N - Tax was not collected") public String getCarRentalTaxExemptIndicator() { return carRentalTaxExemptIndicator; @@ -612,10 +612,10 @@ public AdditionalDataCarRental travelEntertainmentAuthDataDuration(String travel } /** - * Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2 + * Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 2 * @return travelEntertainmentAuthDataDuration **/ - @ApiModelProperty(value = "Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2") + @ApiModelProperty(value = "Number of days the car is rented for. This should be included in the auth message. * Format: Numeric * maxLength: 2") public String getTravelEntertainmentAuthDataDuration() { return travelEntertainmentAuthDataDuration; @@ -634,10 +634,10 @@ public AdditionalDataCarRental travelEntertainmentAuthDataMarket(String travelEn } /** - * Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"A\" for Car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 + * Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 * @return travelEntertainmentAuthDataMarket **/ - @ApiModelProperty(value = "Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"A\" for Car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1") + @ApiModelProperty(value = "Indicates what market-specific dataset will be submitted or is being submitted. Value should be 'A' for car rental. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1") public String getTravelEntertainmentAuthDataMarket() { return travelEntertainmentAuthDataMarket; diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataLevel23.java b/src/main/java/com/adyen/model/checkout/AdditionalDataLevel23.java index 3baddaf0d..2ab430ee4 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataLevel23.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataLevel23.java @@ -126,10 +126,10 @@ public AdditionalDataLevel23 enhancedSchemeDataCustomerReference(String enhanced } /** - * Customer code, if supplied by a customer. Encoding: ASCII. Max length: 25 characters. > Required for Level 2 and Level 3 data. + * The customer code, if supplied by a customer. Encoding: ASCII Max length: 25 characters Must not start with a space or be all spaces Must not be all zeros * @return enhancedSchemeDataCustomerReference **/ - @ApiModelProperty(value = "Customer code, if supplied by a customer. Encoding: ASCII. Max length: 25 characters. > Required for Level 2 and Level 3 data.") + @ApiModelProperty(value = "The customer code, if supplied by a customer. Encoding: ASCII Max length: 25 characters Must not start with a space or be all spaces Must not be all zeros") public String getEnhancedSchemeDataCustomerReference() { return enhancedSchemeDataCustomerReference; @@ -148,10 +148,10 @@ public AdditionalDataLevel23 enhancedSchemeDataDestinationCountryCode(String enh } /** - * Destination country code. Encoding: ASCII. Max length: 3 characters. + * The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. Encoding: ASCII Fixed length: 3 characters * @return enhancedSchemeDataDestinationCountryCode **/ - @ApiModelProperty(value = "Destination country code. Encoding: ASCII. Max length: 3 characters.") + @ApiModelProperty(value = "The three-letter [ISO 3166-1 alpha-3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) for the destination address. Encoding: ASCII Fixed length: 3 characters") public String getEnhancedSchemeDataDestinationCountryCode() { return enhancedSchemeDataDestinationCountryCode; @@ -170,10 +170,10 @@ public AdditionalDataLevel23 enhancedSchemeDataDestinationPostalCode(String enha } /** - * The postal code of a destination address. Encoding: ASCII. Max length: 10 characters. > Required for American Express. + * The postal code of the destination address. Encoding: ASCII Max length: 10 characters Must not start with a space * @return enhancedSchemeDataDestinationPostalCode **/ - @ApiModelProperty(value = "The postal code of a destination address. Encoding: ASCII. Max length: 10 characters. > Required for American Express.") + @ApiModelProperty(value = "The postal code of the destination address. Encoding: ASCII Max length: 10 characters Must not start with a space") public String getEnhancedSchemeDataDestinationPostalCode() { return enhancedSchemeDataDestinationPostalCode; @@ -192,10 +192,10 @@ public AdditionalDataLevel23 enhancedSchemeDataDestinationStateProvinceCode(Stri } /** - * Destination state or province code. Encoding: ASCII.Max length: 3 characters. + * Destination state or province code. Encoding: ASCII Max length: 3 characters Must not start with a space * @return enhancedSchemeDataDestinationStateProvinceCode **/ - @ApiModelProperty(value = "Destination state or province code. Encoding: ASCII.Max length: 3 characters.") + @ApiModelProperty(value = "Destination state or province code. Encoding: ASCII Max length: 3 characters Must not start with a space") public String getEnhancedSchemeDataDestinationStateProvinceCode() { return enhancedSchemeDataDestinationStateProvinceCode; @@ -214,10 +214,10 @@ public AdditionalDataLevel23 enhancedSchemeDataDutyAmount(String enhancedSchemeD } /** - * Duty amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * The duty amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters * @return enhancedSchemeDataDutyAmount **/ - @ApiModelProperty(value = "Duty amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters.") + @ApiModelProperty(value = "The duty amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters") public String getEnhancedSchemeDataDutyAmount() { return enhancedSchemeDataDutyAmount; @@ -236,10 +236,10 @@ public AdditionalDataLevel23 enhancedSchemeDataFreightAmount(String enhancedSche } /** - * Shipping amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters * @return enhancedSchemeDataFreightAmount **/ - @ApiModelProperty(value = "Shipping amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters.") + @ApiModelProperty(value = "The shipping amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters") public String getEnhancedSchemeDataFreightAmount() { return enhancedSchemeDataFreightAmount; @@ -258,10 +258,10 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrCommodityCode } /** - * Item commodity code. Encoding: ASCII. Max length: 12 characters. + * The [UNSPC commodity code](https://www.unspsc.org/) of the item. Encoding: ASCII Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros * @return enhancedSchemeDataItemDetailLineItemNrCommodityCode **/ - @ApiModelProperty(value = "Item commodity code. Encoding: ASCII. Max length: 12 characters.") + @ApiModelProperty(value = "The [UNSPC commodity code](https://www.unspsc.org/) of the item. Encoding: ASCII Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros") public String getEnhancedSchemeDataItemDetailLineItemNrCommodityCode() { return enhancedSchemeDataItemDetailLineItemNrCommodityCode; @@ -280,10 +280,10 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrDescription(S } /** - * Item description. Encoding: ASCII. Max length: 26 characters. + * A description of the item. Encoding: ASCII Max length: 26 characters Must not start with a space or be all spaces Must not be all zeros * @return enhancedSchemeDataItemDetailLineItemNrDescription **/ - @ApiModelProperty(value = "Item description. Encoding: ASCII. Max length: 26 characters.") + @ApiModelProperty(value = "A description of the item. Encoding: ASCII Max length: 26 characters Must not start with a space or be all spaces Must not be all zeros") public String getEnhancedSchemeDataItemDetailLineItemNrDescription() { return enhancedSchemeDataItemDetailLineItemNrDescription; @@ -302,10 +302,10 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrDiscountAmoun } /** - * Discount amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters * @return enhancedSchemeDataItemDetailLineItemNrDiscountAmount **/ - @ApiModelProperty(value = "Discount amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters.") + @ApiModelProperty(value = "The discount amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters") public String getEnhancedSchemeDataItemDetailLineItemNrDiscountAmount() { return enhancedSchemeDataItemDetailLineItemNrDiscountAmount; @@ -324,10 +324,10 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrProductCode(S } /** - * Product code. Encoding: ASCII. Max length: 12 characters. + * The product code. Encoding: ASCII. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros * @return enhancedSchemeDataItemDetailLineItemNrProductCode **/ - @ApiModelProperty(value = "Product code. Encoding: ASCII. Max length: 12 characters.") + @ApiModelProperty(value = "The product code. Encoding: ASCII. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros") public String getEnhancedSchemeDataItemDetailLineItemNrProductCode() { return enhancedSchemeDataItemDetailLineItemNrProductCode; @@ -346,10 +346,10 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrQuantity(Stri } /** - * Quantity, specified as an integer value. Value must be greater than 0. Max length: 12 characters. + * The number of items. Must be an integer greater than zero. Encoding: Numeric Max length: 12 characters Must not start with a space or be all spaces * @return enhancedSchemeDataItemDetailLineItemNrQuantity **/ - @ApiModelProperty(value = "Quantity, specified as an integer value. Value must be greater than 0. Max length: 12 characters.") + @ApiModelProperty(value = "The number of items. Must be an integer greater than zero. Encoding: Numeric Max length: 12 characters Must not start with a space or be all spaces ") public String getEnhancedSchemeDataItemDetailLineItemNrQuantity() { return enhancedSchemeDataItemDetailLineItemNrQuantity; @@ -368,10 +368,10 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrTotalAmount(S } /** - * Total amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. + * The total amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros * @return enhancedSchemeDataItemDetailLineItemNrTotalAmount **/ - @ApiModelProperty(value = "Total amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters.") + @ApiModelProperty(value = "The total amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Max length: 12 characters Must not start with a space or be all spaces Must not be all zeros") public String getEnhancedSchemeDataItemDetailLineItemNrTotalAmount() { return enhancedSchemeDataItemDetailLineItemNrTotalAmount; @@ -390,10 +390,10 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure } /** - * Item unit of measurement. Encoding: ASCII. Max length: 3 characters. + * The unit of measurement for an item. Encoding: ASCII Max length: 3 characters Must not start with a space or be all spaces Must not be all zeros * @return enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure **/ - @ApiModelProperty(value = "Item unit of measurement. Encoding: ASCII. Max length: 3 characters.") + @ApiModelProperty(value = "The unit of measurement for an item. Encoding: ASCII Max length: 3 characters Must not start with a space or be all spaces Must not be all zeros") public String getEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure() { return enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure; @@ -412,10 +412,10 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrUnitPrice(Str } /** - * Unit price, specified in [minor units](https://docs.adyen.com/development-resources/currency-codes). Max length: 12 characters. + * The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters * @return enhancedSchemeDataItemDetailLineItemNrUnitPrice **/ - @ApiModelProperty(value = "Unit price, specified in [minor units](https://docs.adyen.com/development-resources/currency-codes). Max length: 12 characters.") + @ApiModelProperty(value = "The unit price in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters") public String getEnhancedSchemeDataItemDetailLineItemNrUnitPrice() { return enhancedSchemeDataItemDetailLineItemNrUnitPrice; @@ -434,10 +434,10 @@ public AdditionalDataLevel23 enhancedSchemeDataOrderDate(String enhancedSchemeDa } /** - * Order date. * Format: `ddMMyy` Encoding: ASCII. Max length: 6 characters. + * The order date. * Format: `ddMMyy` Encoding: ASCII Max length: 6 characters * @return enhancedSchemeDataOrderDate **/ - @ApiModelProperty(value = "Order date. * Format: `ddMMyy` Encoding: ASCII. Max length: 6 characters.") + @ApiModelProperty(value = "The order date. * Format: `ddMMyy` Encoding: ASCII Max length: 6 characters") public String getEnhancedSchemeDataOrderDate() { return enhancedSchemeDataOrderDate; @@ -456,10 +456,10 @@ public AdditionalDataLevel23 enhancedSchemeDataShipFromPostalCode(String enhance } /** - * The postal code of a \"ship-from\" address. Encoding: ASCII. Max length: 10 characters. + * The postal code of the address the item is shipped from. Encoding: ASCII Max length: 10 characters Must not start with a space or be all spaces Must not be all zeros * @return enhancedSchemeDataShipFromPostalCode **/ - @ApiModelProperty(value = "The postal code of a \"ship-from\" address. Encoding: ASCII. Max length: 10 characters.") + @ApiModelProperty(value = "The postal code of the address the item is shipped from. Encoding: ASCII Max length: 10 characters Must not start with a space or be all spaces Must not be all zeros") public String getEnhancedSchemeDataShipFromPostalCode() { return enhancedSchemeDataShipFromPostalCode; @@ -478,10 +478,10 @@ public AdditionalDataLevel23 enhancedSchemeDataTotalTaxAmount(String enhancedSch } /** - * Total tax amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. > Required for Level 2 and Level 3 data. + * The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters * @return enhancedSchemeDataTotalTaxAmount **/ - @ApiModelProperty(value = "Total tax amount, in minor units. For example, 2000 means USD 20.00. Max length: 12 characters. > Required for Level 2 and Level 3 data.") + @ApiModelProperty(value = "The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00. Encoding: Numeric Max length: 12 characters ") public String getEnhancedSchemeDataTotalTaxAmount() { return enhancedSchemeDataTotalTaxAmount; diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java b/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java index 30198fa3a..8d064545f 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java @@ -96,10 +96,6 @@ public class AdditionalDataLodging { @SerializedName(SERIALIZED_NAME_LODGING_ROOM1_RATE) private String lodgingRoom1Rate; - public static final String SERIALIZED_NAME_LODGING_ROOM1_TAX = "lodging.room1.tax"; - @SerializedName(SERIALIZED_NAME_LODGING_ROOM1_TAX) - private String lodgingRoom1Tax; - public static final String SERIALIZED_NAME_LODGING_TOTAL_ROOM_TAX = "lodging.totalRoomTax"; @SerializedName(SERIALIZED_NAME_LODGING_TOTAL_ROOM_TAX) private String lodgingTotalRoomTax; @@ -170,10 +166,10 @@ public AdditionalDataLodging lodgingCustomerServiceTollFreeNumber(String lodging } /** - * The toll-free phone number for the lodging. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail. + * The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - * @return lodgingCustomerServiceTollFreeNumber **/ - @ApiModelProperty(value = "The toll-free phone number for the lodging. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail.") + @ApiModelProperty(value = "The toll-free phone number for the lodging. * Format: numeric * Max length: 17 characters. * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or -") public String getLodgingCustomerServiceTollFreeNumber() { return lodgingCustomerServiceTollFreeNumber; @@ -192,10 +188,10 @@ public AdditionalDataLodging lodgingFireSafetyActIndicator(String lodgingFireSaf } /** - * Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: alphabetic. * Max length: 1 character. + * Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character * @return lodgingFireSafetyActIndicator **/ - @ApiModelProperty(value = "Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: alphabetic. * Max length: 1 character.") + @ApiModelProperty(value = "Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Must be 'Y' or 'N'. * Format: alphabetic * Max length: 1 character") public String getLodgingFireSafetyActIndicator() { return lodgingFireSafetyActIndicator; @@ -214,10 +210,10 @@ public AdditionalDataLodging lodgingFolioCashAdvances(String lodgingFolioCashAdv } /** - * The folio cash advances. * Format: numeric. * Max length: 12 characters. + * The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * @return lodgingFolioCashAdvances **/ - @ApiModelProperty(value = "The folio cash advances. * Format: numeric. * Max length: 12 characters.") + @ApiModelProperty(value = "The folio cash advances, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters") public String getLodgingFolioCashAdvances() { return lodgingFolioCashAdvances; @@ -236,10 +232,10 @@ public AdditionalDataLodging lodgingFolioNumber(String lodgingFolioNumber) { } /** - * The card acceptor’s internal invoice or billing ID reference number. * Format: alphanumeric. * Max length: 25 characters. + * The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters. * Must not start with a space * Must not be all zeros * @return lodgingFolioNumber **/ - @ApiModelProperty(value = "The card acceptor’s internal invoice or billing ID reference number. * Format: alphanumeric. * Max length: 25 characters.") + @ApiModelProperty(value = "The card acceptor’s internal invoice or billing ID reference number. * Max length: 25 characters. * Must not start with a space * Must not be all zeros") public String getLodgingFolioNumber() { return lodgingFolioNumber; @@ -258,10 +254,10 @@ public AdditionalDataLodging lodgingFoodBeverageCharges(String lodgingFoodBevera } /** - * The additional charges for food and beverages associated with the booking. * Format: numeric. * Max length: 12 characters. + * Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * @return lodgingFoodBeverageCharges **/ - @ApiModelProperty(value = "The additional charges for food and beverages associated with the booking. * Format: numeric. * Max length: 12 characters.") + @ApiModelProperty(value = "Any charges for food and beverages associated with the booking, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters") public String getLodgingFoodBeverageCharges() { return lodgingFoodBeverageCharges; @@ -280,10 +276,10 @@ public AdditionalDataLodging lodgingNoShowIndicator(String lodgingNoShowIndicato } /** - * Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in. **N**: the customer checked in. + * Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in * **N**: the customer checked in * @return lodgingNoShowIndicator **/ - @ApiModelProperty(value = "Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in. **N**: the customer checked in.") + @ApiModelProperty(value = "Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in * **N**: the customer checked in") public String getLodgingNoShowIndicator() { return lodgingNoShowIndicator; @@ -302,10 +298,10 @@ public AdditionalDataLodging lodgingPrepaidExpenses(String lodgingPrepaidExpense } /** - * The prepaid expenses for the booking. * Format: numeric. * Max length: 12 characters. + * The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters * @return lodgingPrepaidExpenses **/ - @ApiModelProperty(value = "The prepaid expenses for the booking. * Format: numeric. * Max length: 12 characters.") + @ApiModelProperty(value = "The prepaid expenses for the booking. * Format: numeric * Max length: 12 characters") public String getLodgingPrepaidExpenses() { return lodgingPrepaidExpenses; @@ -324,10 +320,10 @@ public AdditionalDataLodging lodgingPropertyPhoneNumber(String lodgingPropertyPh } /** - * Identifies the location of the lodging by its local phone number. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail. + * The lodging property location's phone number. * Format: numeric. * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or - * @return lodgingPropertyPhoneNumber **/ - @ApiModelProperty(value = "Identifies the location of the lodging by its local phone number. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail.") + @ApiModelProperty(value = "The lodging property location's phone number. * Format: numeric. * Min length: 10 characters * Max length: 17 characters * For US and CA numbers must be 10 characters in length * Must not start with a space * Must not be all zeros * Must not contain any special characters such as + or -") public String getLodgingPropertyPhoneNumber() { return lodgingPropertyPhoneNumber; @@ -346,10 +342,10 @@ public AdditionalDataLodging lodgingRoom1NumberOfNights(String lodgingRoom1Numbe } /** - * The total number of nights the room is booked for. * Format: numeric. * Max length: 4 characters. + * The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 2 characters * @return lodgingRoom1NumberOfNights **/ - @ApiModelProperty(value = "The total number of nights the room is booked for. * Format: numeric. * Max length: 4 characters.") + @ApiModelProperty(value = "The total number of nights the room is booked for. * Format: numeric * Must be a number between 0 and 99 * Max length: 2 characters") public String getLodgingRoom1NumberOfNights() { return lodgingRoom1NumberOfNights; @@ -368,10 +364,10 @@ public AdditionalDataLodging lodgingRoom1Rate(String lodgingRoom1Rate) { } /** - * The rate of the room. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number * @return lodgingRoom1Rate **/ - @ApiModelProperty(value = "The rate of the room. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes).") + @ApiModelProperty(value = "The rate for the room, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number") public String getLodgingRoom1Rate() { return lodgingRoom1Rate; @@ -383,28 +379,6 @@ public void setLodgingRoom1Rate(String lodgingRoom1Rate) { } - public AdditionalDataLodging lodgingRoom1Tax(String lodgingRoom1Tax) { - - this.lodgingRoom1Tax = lodgingRoom1Tax; - return this; - } - - /** - * The total amount of tax to be paid. * Format: numeric. * Max length: 12 chracters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). - * @return lodgingRoom1Tax - **/ - @ApiModelProperty(value = "The total amount of tax to be paid. * Format: numeric. * Max length: 12 chracters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes).") - - public String getLodgingRoom1Tax() { - return lodgingRoom1Tax; - } - - - public void setLodgingRoom1Tax(String lodgingRoom1Tax) { - this.lodgingRoom1Tax = lodgingRoom1Tax; - } - - public AdditionalDataLodging lodgingTotalRoomTax(String lodgingTotalRoomTax) { this.lodgingTotalRoomTax = lodgingTotalRoomTax; @@ -412,10 +386,10 @@ public AdditionalDataLodging lodgingTotalRoomTax(String lodgingTotalRoomTax) { } /** - * The total room tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * The total room tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number * @return lodgingTotalRoomTax **/ - @ApiModelProperty(value = "The total room tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes).") + @ApiModelProperty(value = "The total room tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number") public String getLodgingTotalRoomTax() { return lodgingTotalRoomTax; @@ -434,10 +408,10 @@ public AdditionalDataLodging lodgingTotalTax(String lodgingTotalTax) { } /** - * The total tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number * @return lodgingTotalTax **/ - @ApiModelProperty(value = "The total tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes).") + @ApiModelProperty(value = "The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Format: numeric * Max length: 12 characters * Must not be a negative number") public String getLodgingTotalTax() { return lodgingTotalTax; @@ -456,10 +430,10 @@ public AdditionalDataLodging travelEntertainmentAuthDataDuration(String travelEn } /** - * The number of nights. This should be included in the auth message. * Format: numeric. * Max length: 2 characters. + * The number of nights. This should be included in the auth message. * Format: numeric * Max length: 2 characters * @return travelEntertainmentAuthDataDuration **/ - @ApiModelProperty(value = "The number of nights. This should be included in the auth message. * Format: numeric. * Max length: 2 characters.") + @ApiModelProperty(value = "The number of nights. This should be included in the auth message. * Format: numeric * Max length: 2 characters") public String getTravelEntertainmentAuthDataDuration() { return travelEntertainmentAuthDataDuration; @@ -478,10 +452,10 @@ public AdditionalDataLodging travelEntertainmentAuthDataMarket(String travelEnte } /** - * Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: alphanumeric. * Max length: 1 character. + * Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character * @return travelEntertainmentAuthDataMarket **/ - @ApiModelProperty(value = "Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: alphanumeric. * Max length: 1 character.") + @ApiModelProperty(value = "Indicates what market-specific dataset will be submitted. Must be 'H' for Hotel. This should be included in the auth message. * Format: alphanumeric * Max length: 1 character") public String getTravelEntertainmentAuthDataMarket() { return travelEntertainmentAuthDataMarket; @@ -515,7 +489,6 @@ public boolean equals(Object o) { Objects.equals(this.lodgingPropertyPhoneNumber, additionalDataLodging.lodgingPropertyPhoneNumber) && Objects.equals(this.lodgingRoom1NumberOfNights, additionalDataLodging.lodgingRoom1NumberOfNights) && Objects.equals(this.lodgingRoom1Rate, additionalDataLodging.lodgingRoom1Rate) && - Objects.equals(this.lodgingRoom1Tax, additionalDataLodging.lodgingRoom1Tax) && Objects.equals(this.lodgingTotalRoomTax, additionalDataLodging.lodgingTotalRoomTax) && Objects.equals(this.lodgingTotalTax, additionalDataLodging.lodgingTotalTax) && Objects.equals(this.travelEntertainmentAuthDataDuration, additionalDataLodging.travelEntertainmentAuthDataDuration) && @@ -524,7 +497,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(lodgingCheckInDate, lodgingCheckOutDate, lodgingCustomerServiceTollFreeNumber, lodgingFireSafetyActIndicator, lodgingFolioCashAdvances, lodgingFolioNumber, lodgingFoodBeverageCharges, lodgingNoShowIndicator, lodgingPrepaidExpenses, lodgingPropertyPhoneNumber, lodgingRoom1NumberOfNights, lodgingRoom1Rate, lodgingRoom1Tax, lodgingTotalRoomTax, lodgingTotalTax, travelEntertainmentAuthDataDuration, travelEntertainmentAuthDataMarket); + return Objects.hash(lodgingCheckInDate, lodgingCheckOutDate, lodgingCustomerServiceTollFreeNumber, lodgingFireSafetyActIndicator, lodgingFolioCashAdvances, lodgingFolioNumber, lodgingFoodBeverageCharges, lodgingNoShowIndicator, lodgingPrepaidExpenses, lodgingPropertyPhoneNumber, lodgingRoom1NumberOfNights, lodgingRoom1Rate, lodgingTotalRoomTax, lodgingTotalTax, travelEntertainmentAuthDataDuration, travelEntertainmentAuthDataMarket); } @Override @@ -543,7 +516,6 @@ public String toString() { sb.append(" lodgingPropertyPhoneNumber: ").append(toIndentedString(lodgingPropertyPhoneNumber)).append("\n"); sb.append(" lodgingRoom1NumberOfNights: ").append(toIndentedString(lodgingRoom1NumberOfNights)).append("\n"); sb.append(" lodgingRoom1Rate: ").append(toIndentedString(lodgingRoom1Rate)).append("\n"); - sb.append(" lodgingRoom1Tax: ").append(toIndentedString(lodgingRoom1Tax)).append("\n"); sb.append(" lodgingTotalRoomTax: ").append(toIndentedString(lodgingTotalRoomTax)).append("\n"); sb.append(" lodgingTotalTax: ").append(toIndentedString(lodgingTotalTax)).append("\n"); sb.append(" travelEntertainmentAuthDataDuration: ").append(toIndentedString(travelEntertainmentAuthDataDuration)).append("\n"); @@ -582,7 +554,6 @@ private String toIndentedString(Object o) { openapiFields.add("lodging.propertyPhoneNumber"); openapiFields.add("lodging.room1.numberOfNights"); openapiFields.add("lodging.room1.rate"); - openapiFields.add("lodging.room1.tax"); openapiFields.add("lodging.totalRoomTax"); openapiFields.add("lodging.totalTax"); openapiFields.add("travelEntertainmentAuthData.duration"); @@ -662,10 +633,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("lodging.room1.rate") != null && !jsonObj.get("lodging.room1.rate").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `lodging.room1.rate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.room1.rate").toString())); } - // validate the optional field lodging.room1.tax - if (jsonObj.get("lodging.room1.tax") != null && !jsonObj.get("lodging.room1.tax").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.room1.tax` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.room1.tax").toString())); - } // validate the optional field lodging.totalRoomTax if (jsonObj.get("lodging.totalRoomTax") != null && !jsonObj.get("lodging.totalRoomTax").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `lodging.totalRoomTax` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.totalRoomTax").toString())); diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataTemporaryServices.java b/src/main/java/com/adyen/model/checkout/AdditionalDataTemporaryServices.java index eb48cef02..2772e56ad 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataTemporaryServices.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataTemporaryServices.java @@ -94,10 +94,10 @@ public AdditionalDataTemporaryServices enhancedSchemeDataCustomerReference(Strin } /** - * Customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 + * The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25 * @return enhancedSchemeDataCustomerReference **/ - @ApiModelProperty(value = "Customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25") + @ApiModelProperty(value = "The customer code, if supplied by a customer. * Encoding: ASCII * maxLength: 25") public String getEnhancedSchemeDataCustomerReference() { return enhancedSchemeDataCustomerReference; @@ -116,10 +116,10 @@ public AdditionalDataTemporaryServices enhancedSchemeDataEmployeeName(String enh } /** - * Name or ID associated with the individual working in a temporary capacity. * maxLength: 40 + * The name or ID of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces * @return enhancedSchemeDataEmployeeName **/ - @ApiModelProperty(value = "Name or ID associated with the individual working in a temporary capacity. * maxLength: 40") + @ApiModelProperty(value = "The name or ID of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces") public String getEnhancedSchemeDataEmployeeName() { return enhancedSchemeDataEmployeeName; @@ -138,10 +138,10 @@ public AdditionalDataTemporaryServices enhancedSchemeDataJobDescription(String e } /** - * Description of the job or task of the individual working in a temporary capacity. * maxLength: 40 + * The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces * @return enhancedSchemeDataJobDescription **/ - @ApiModelProperty(value = "Description of the job or task of the individual working in a temporary capacity. * maxLength: 40") + @ApiModelProperty(value = "The job description of the person working in a temporary capacity. * maxLength: 40 * Must not be all zeros * Must not be all spaces") public String getEnhancedSchemeDataJobDescription() { return enhancedSchemeDataJobDescription; @@ -160,10 +160,10 @@ public AdditionalDataTemporaryServices enhancedSchemeDataRegularHoursRate(String } /** - * Amount paid per regular hours worked, minor units. * maxLength: 7 + * The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros * @return enhancedSchemeDataRegularHoursRate **/ - @ApiModelProperty(value = "Amount paid per regular hours worked, minor units. * maxLength: 7") + @ApiModelProperty(value = "The amount paid for regular hours worked, [minor units](https://docs.adyen.com/development-resources/currency-codes). * maxLength: 7 * Must not be empty * Can be all zeros") public String getEnhancedSchemeDataRegularHoursRate() { return enhancedSchemeDataRegularHoursRate; @@ -182,10 +182,10 @@ public AdditionalDataTemporaryServices enhancedSchemeDataRegularHoursWorked(Stri } /** - * Amount of time worked during a normal operation for the task or job. * maxLength: 7 + * The hours worked. * maxLength: 7 * Must not be empty * Can be all zeros * @return enhancedSchemeDataRegularHoursWorked **/ - @ApiModelProperty(value = "Amount of time worked during a normal operation for the task or job. * maxLength: 7") + @ApiModelProperty(value = "The hours worked. * maxLength: 7 * Must not be empty * Can be all zeros") public String getEnhancedSchemeDataRegularHoursWorked() { return enhancedSchemeDataRegularHoursWorked; @@ -204,10 +204,10 @@ public AdditionalDataTemporaryServices enhancedSchemeDataRequestName(String enha } /** - * Name of the individual requesting temporary services. * maxLength: 40 + * The name of the person requesting temporary services. * maxLength: 40 * Must not be all zeros * Must not be all spaces * @return enhancedSchemeDataRequestName **/ - @ApiModelProperty(value = "Name of the individual requesting temporary services. * maxLength: 40") + @ApiModelProperty(value = "The name of the person requesting temporary services. * maxLength: 40 * Must not be all zeros * Must not be all spaces") public String getEnhancedSchemeDataRequestName() { return enhancedSchemeDataRequestName; @@ -226,10 +226,10 @@ public AdditionalDataTemporaryServices enhancedSchemeDataTempStartDate(String en } /** - * Date for the beginning of the pay period. * Format: ddMMyy * maxLength: 6 + * The billing period start date. * Format: ddMMyy * maxLength: 6 * @return enhancedSchemeDataTempStartDate **/ - @ApiModelProperty(value = "Date for the beginning of the pay period. * Format: ddMMyy * maxLength: 6") + @ApiModelProperty(value = "The billing period start date. * Format: ddMMyy * maxLength: 6") public String getEnhancedSchemeDataTempStartDate() { return enhancedSchemeDataTempStartDate; @@ -248,10 +248,10 @@ public AdditionalDataTemporaryServices enhancedSchemeDataTempWeekEnding(String e } /** - * Date of the end of the billing cycle. * Format: ddMMyy * maxLength: 6 + * The billing period end date. * Format: ddMMyy * maxLength: 6 * @return enhancedSchemeDataTempWeekEnding **/ - @ApiModelProperty(value = "Date of the end of the billing cycle. * Format: ddMMyy * maxLength: 6") + @ApiModelProperty(value = "The billing period end date. * Format: ddMMyy * maxLength: 6") public String getEnhancedSchemeDataTempWeekEnding() { return enhancedSchemeDataTempWeekEnding; @@ -270,10 +270,10 @@ public AdditionalDataTemporaryServices enhancedSchemeDataTotalTaxAmount(String e } /** - * Total tax amount, in minor units. For example, 2000 means USD 20.00 * maxLength: 12 + * The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00 * maxLength: 12 * @return enhancedSchemeDataTotalTaxAmount **/ - @ApiModelProperty(value = "Total tax amount, in minor units. For example, 2000 means USD 20.00 * maxLength: 12") + @ApiModelProperty(value = "The total tax amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes). For example, 2000 means USD 20.00 * maxLength: 12") public String getEnhancedSchemeDataTotalTaxAmount() { return enhancedSchemeDataTotalTaxAmount; diff --git a/src/main/java/com/adyen/model/checkout/CardDetails.java b/src/main/java/com/adyen/model/checkout/CardDetails.java index f21a82c1c..c6f738cac 100644 --- a/src/main/java/com/adyen/model/checkout/CardDetails.java +++ b/src/main/java/com/adyen/model/checkout/CardDetails.java @@ -610,10 +610,10 @@ public CardDetails threeDS2SdkVersion(String threeDS2SdkVersion) { } /** - * Version of the 3D Secure 2 mobile SDK. + * Required for mobile integrations. Version of the 3D Secure 2 mobile SDK. * @return threeDS2SdkVersion **/ - @ApiModelProperty(value = "Version of the 3D Secure 2 mobile SDK.") + @ApiModelProperty(value = "Required for mobile integrations. Version of the 3D Secure 2 mobile SDK.") public String getThreeDS2SdkVersion() { return threeDS2SdkVersion; diff --git a/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java b/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java index 2d52c4c19..efd6f2f9c 100644 --- a/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java +++ b/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `brands` (array) for (int i = 0; i < jsonArraybrands.size(); i++) { CardBrandDetails.validateJsonObject(jsonArraybrands.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java b/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java index 931b2c8ab..985f6369f 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java @@ -1695,7 +1695,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field store if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java index fecbb8021..f7d65cb15 100644 --- a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java @@ -2044,7 +2044,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `lineItems` (array) for (int i = 0; i < jsonArraylineItems.size(); i++) { LineItem.validateJsonObject(jsonArraylineItems.get(i).getAsJsonObject()); - }; + } } // validate the optional field `mandate` if (jsonObj.getAsJsonObject("mandate") != null) { @@ -2146,7 +2146,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field store if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java index d0d5a4fba..cdc8f203d 100644 --- a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java +++ b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java @@ -2183,7 +2183,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `lineItems` (array) for (int i = 0; i < jsonArraylineItems.size(); i++) { LineItem.validateJsonObject(jsonArraylineItems.get(i).getAsJsonObject()); - }; + } } // validate the optional field `mandate` if (jsonObj.getAsJsonObject("mandate") != null) { @@ -2296,7 +2296,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field store if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/checkout/CreatePaymentAmountUpdateRequest.java b/src/main/java/com/adyen/model/checkout/CreatePaymentAmountUpdateRequest.java index 0f248b659..ba5bdf44e 100644 --- a/src/main/java/com/adyen/model/checkout/CreatePaymentAmountUpdateRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreatePaymentAmountUpdateRequest.java @@ -365,7 +365,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/checkout/CreatePaymentCaptureRequest.java b/src/main/java/com/adyen/model/checkout/CreatePaymentCaptureRequest.java index 571bf41e2..38667ec44 100644 --- a/src/main/java/com/adyen/model/checkout/CreatePaymentCaptureRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreatePaymentCaptureRequest.java @@ -310,7 +310,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `lineItems` (array) for (int i = 0; i < jsonArraylineItems.size(); i++) { LineItem.validateJsonObject(jsonArraylineItems.get(i).getAsJsonObject()); - }; + } } // validate the optional field merchantAccount if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { @@ -330,7 +330,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/checkout/CreatePaymentLinkRequest.java b/src/main/java/com/adyen/model/checkout/CreatePaymentLinkRequest.java index 66e8f7442..8bac7c492 100644 --- a/src/main/java/com/adyen/model/checkout/CreatePaymentLinkRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreatePaymentLinkRequest.java @@ -1500,7 +1500,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `lineItems` (array) for (int i = 0; i < jsonArraylineItems.size(); i++) { LineItem.validateJsonObject(jsonArraylineItems.get(i).getAsJsonObject()); - }; + } } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { @@ -1571,7 +1571,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field store if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/checkout/CreatePaymentRefundRequest.java b/src/main/java/com/adyen/model/checkout/CreatePaymentRefundRequest.java index 30a9c0598..9dbe36723 100644 --- a/src/main/java/com/adyen/model/checkout/CreatePaymentRefundRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreatePaymentRefundRequest.java @@ -392,7 +392,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `lineItems` (array) for (int i = 0; i < jsonArraylineItems.size(); i++) { LineItem.validateJsonObject(jsonArraylineItems.get(i).getAsJsonObject()); - }; + } } // validate the optional field merchantAccount if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { @@ -419,7 +419,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/checkout/FraudResult.java b/src/main/java/com/adyen/model/checkout/FraudResult.java index 05f50372d..5a7f53df0 100644 --- a/src/main/java/com/adyen/model/checkout/FraudResult.java +++ b/src/main/java/com/adyen/model/checkout/FraudResult.java @@ -208,7 +208,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `results` (array) for (int i = 0; i < jsonArrayresults.size(); i++) { FraudCheckResult.validateJsonObject(jsonArrayresults.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/checkout/InputDetail.java b/src/main/java/com/adyen/model/checkout/InputDetail.java index 766e70dc7..01aedcd45 100644 --- a/src/main/java/com/adyen/model/checkout/InputDetail.java +++ b/src/main/java/com/adyen/model/checkout/InputDetail.java @@ -432,7 +432,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `details` (array) for (int i = 0; i < jsonArraydetails.size(); i++) { SubInputDetail.validateJsonObject(jsonArraydetails.get(i).getAsJsonObject()); - }; + } } JsonArray jsonArrayinputDetails = jsonObj.getAsJsonArray("inputDetails"); if (jsonArrayinputDetails != null) { @@ -444,7 +444,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `inputDetails` (array) for (int i = 0; i < jsonArrayinputDetails.size(); i++) { SubInputDetail.validateJsonObject(jsonArrayinputDetails.get(i).getAsJsonObject()); - }; + } } // validate the optional field itemSearchUrl if (jsonObj.get("itemSearchUrl") != null && !jsonObj.get("itemSearchUrl").isJsonPrimitive()) { @@ -460,7 +460,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `items` (array) for (int i = 0; i < jsonArrayitems.size(); i++) { Item.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; + } } // validate the optional field key if (jsonObj.get("key") != null && !jsonObj.get("key").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java b/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java index 599602604..68f456abe 100644 --- a/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java +++ b/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java @@ -237,7 +237,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `storedPaymentMethods` (array) for (int i = 0; i < jsonArraystoredPaymentMethods.size(); i++) { StoredPaymentMethodResource.validateJsonObject(jsonArraystoredPaymentMethods.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateResource.java b/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateResource.java index e1f1905d6..37b6e0f93 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateResource.java +++ b/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateResource.java @@ -509,7 +509,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // ensure the field status can be parsed to an enum value if (jsonObj.get("status") != null) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentCaptureResource.java b/src/main/java/com/adyen/model/checkout/PaymentCaptureResource.java index 97e25565e..718c0def0 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentCaptureResource.java +++ b/src/main/java/com/adyen/model/checkout/PaymentCaptureResource.java @@ -445,7 +445,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `lineItems` (array) for (int i = 0; i < jsonArraylineItems.size(); i++) { LineItem.validateJsonObject(jsonArraylineItems.get(i).getAsJsonObject()); - }; + } } // validate the optional field merchantAccount if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { @@ -473,7 +473,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // ensure the field status can be parsed to an enum value if (jsonObj.get("status") != null) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java b/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java index 0f723e0a9..1c219e736 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java @@ -2495,7 +2495,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `lineItems` (array) for (int i = 0; i < jsonArraylineItems.size(); i++) { LineItem.validateJsonObject(jsonArraylineItems.get(i).getAsJsonObject()); - }; + } } // validate the optional field `mandate` if (jsonObj.getAsJsonObject("mandate") != null) { @@ -2625,7 +2625,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field store if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java b/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java index 2d87a36e6..fb934dbc7 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java @@ -1668,7 +1668,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `lineItems` (array) for (int i = 0; i < jsonArraylineItems.size(); i++) { LineItem.validateJsonObject(jsonArraylineItems.get(i).getAsJsonObject()); - }; + } } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { @@ -1739,7 +1739,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // ensure the field status can be parsed to an enum value if (jsonObj.get("status") != null) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethod.java b/src/main/java/com/adyen/model/checkout/PaymentMethod.java index 50d4349e2..f810ad671 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethod.java @@ -497,7 +497,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `inputDetails` (array) for (int i = 0; i < jsonArrayinputDetails.size(); i++) { InputDetail.validateJsonObject(jsonArrayinputDetails.get(i).getAsJsonObject()); - }; + } } JsonArray jsonArrayissuers = jsonObj.getAsJsonArray("issuers"); if (jsonArrayissuers != null) { @@ -509,7 +509,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `issuers` (array) for (int i = 0; i < jsonArrayissuers.size(); i++) { PaymentMethodIssuer.validateJsonObject(jsonArrayissuers.get(i).getAsJsonObject()); - }; + } } // validate the optional field name if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java b/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java index a751706f0..8edd722ff 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java @@ -209,7 +209,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `paymentMethods` (array) for (int i = 0; i < jsonArraypaymentMethods.size(); i++) { PaymentMethod.validateJsonObject(jsonArraypaymentMethods.get(i).getAsJsonObject()); - }; + } } JsonArray jsonArraystoredPaymentMethods = jsonObj.getAsJsonArray("storedPaymentMethods"); if (jsonArraystoredPaymentMethods != null) { @@ -221,7 +221,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `storedPaymentMethods` (array) for (int i = 0; i < jsonArraystoredPaymentMethods.size(); i++) { StoredPaymentMethod.validateJsonObject(jsonArraystoredPaymentMethods.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/checkout/PaymentRefundResource.java b/src/main/java/com/adyen/model/checkout/PaymentRefundResource.java index a59cae941..dea547776 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentRefundResource.java +++ b/src/main/java/com/adyen/model/checkout/PaymentRefundResource.java @@ -527,7 +527,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `lineItems` (array) for (int i = 0; i < jsonArraylineItems.size(); i++) { LineItem.validateJsonObject(jsonArraylineItems.get(i).getAsJsonObject()); - }; + } } // validate the optional field merchantAccount if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { @@ -562,7 +562,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // ensure the field status can be parsed to an enum value if (jsonObj.get("status") != null) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentRequest.java b/src/main/java/com/adyen/model/checkout/PaymentRequest.java index 4a9ef3860..e599f2aa7 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentRequest.java @@ -2395,7 +2395,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `lineItems` (array) for (int i = 0; i < jsonArraylineItems.size(); i++) { LineItem.validateJsonObject(jsonArraylineItems.get(i).getAsJsonObject()); - }; + } } // validate the optional field `mandate` if (jsonObj.getAsJsonObject("mandate") != null) { @@ -2525,7 +2525,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field store if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java b/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java index 408ecb8d4..f3a9dd05f 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java @@ -2063,7 +2063,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `lineItems` (array) for (int i = 0; i < jsonArraylineItems.size(); i++) { LineItem.validateJsonObject(jsonArraylineItems.get(i).getAsJsonObject()); - }; + } } // validate the optional field `mandate` if (jsonObj.getAsJsonObject("mandate") != null) { @@ -2166,7 +2166,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field store if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentSetupResponse.java b/src/main/java/com/adyen/model/checkout/PaymentSetupResponse.java index c9a51a17a..cf48c1c9e 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentSetupResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentSetupResponse.java @@ -206,7 +206,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `recurringDetails` (array) for (int i = 0; i < jsonArrayrecurringDetails.size(); i++) { RecurringDetail.validateJsonObject(jsonArrayrecurringDetails.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/checkout/RecurringDetail.java b/src/main/java/com/adyen/model/checkout/RecurringDetail.java index 6742a51ef..02144644c 100644 --- a/src/main/java/com/adyen/model/checkout/RecurringDetail.java +++ b/src/main/java/com/adyen/model/checkout/RecurringDetail.java @@ -556,7 +556,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `inputDetails` (array) for (int i = 0; i < jsonArrayinputDetails.size(); i++) { InputDetail.validateJsonObject(jsonArrayinputDetails.get(i).getAsJsonObject()); - }; + } } JsonArray jsonArrayissuers = jsonObj.getAsJsonArray("issuers"); if (jsonArrayissuers != null) { @@ -568,7 +568,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `issuers` (array) for (int i = 0; i < jsonArrayissuers.size(); i++) { PaymentMethodIssuer.validateJsonObject(jsonArrayissuers.get(i).getAsJsonObject()); - }; + } } // validate the optional field name if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/checkout/SubInputDetail.java b/src/main/java/com/adyen/model/checkout/SubInputDetail.java index 990ed1b6e..bf6c72d0c 100644 --- a/src/main/java/com/adyen/model/checkout/SubInputDetail.java +++ b/src/main/java/com/adyen/model/checkout/SubInputDetail.java @@ -326,7 +326,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `items` (array) for (int i = 0; i < jsonArrayitems.size(); i++) { Item.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; + } } // validate the optional field key if (jsonObj.get("key") != null && !jsonObj.get("key").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java index 2058f81a3..5aacc7da1 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java @@ -134,10 +134,10 @@ public CapabilityProblemEntity addDocumentsItem(String documentsItem) { } /** - * Get documents + * List of document IDs corresponding to the verification errors from capabilities. * @return documents **/ - @ApiModelProperty(value = "") + @ApiModelProperty(value = "List of document IDs corresponding to the verification errors from capabilities.") public List getDocuments() { return documents; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java index 303baf494..2c8790700 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java @@ -129,10 +129,10 @@ public CapabilityProblemEntityRecursive addDocumentsItem(String documentsItem) { } /** - * Get documents + * List of document IDs corresponding to the verification errors from capabilities. * @return documents **/ - @ApiModelProperty(value = "") + @ApiModelProperty(value = "List of document IDs corresponding to the verification errors from capabilities.") public List getDocuments() { return documents; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java index 9de13b6ff..0a676b52c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java @@ -60,9 +60,21 @@ public class TransferInstrumentReference { @SerializedName(SERIALIZED_NAME_REAL_LAST_FOUR) private String realLastFour; + public static final String SERIALIZED_NAME_TRUSTED_SOURCE = "trustedSource"; + @SerializedName(SERIALIZED_NAME_TRUSTED_SOURCE) + private Boolean trustedSource; + public TransferInstrumentReference() { } + + public TransferInstrumentReference( + Boolean trustedSource + ) { + this(); + this.trustedSource = trustedSource; + } + public TransferInstrumentReference accountIdentifier(String accountIdentifier) { this.accountIdentifier = accountIdentifier; @@ -129,6 +141,19 @@ public void setRealLastFour(String realLastFour) { } + /** + * Identifies if the TI was created from a trusted source. + * @return trustedSource + **/ + @ApiModelProperty(value = "Identifies if the TI was created from a trusted source.") + + public Boolean getTrustedSource() { + return trustedSource; + } + + + + @Override public boolean equals(Object o) { @@ -141,12 +166,13 @@ public boolean equals(Object o) { TransferInstrumentReference transferInstrumentReference = (TransferInstrumentReference) o; return Objects.equals(this.accountIdentifier, transferInstrumentReference.accountIdentifier) && Objects.equals(this.id, transferInstrumentReference.id) && - Objects.equals(this.realLastFour, transferInstrumentReference.realLastFour); + Objects.equals(this.realLastFour, transferInstrumentReference.realLastFour) && + Objects.equals(this.trustedSource, transferInstrumentReference.trustedSource); } @Override public int hashCode() { - return Objects.hash(accountIdentifier, id, realLastFour); + return Objects.hash(accountIdentifier, id, realLastFour, trustedSource); } @Override @@ -156,6 +182,7 @@ public String toString() { sb.append(" accountIdentifier: ").append(toIndentedString(accountIdentifier)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" realLastFour: ").append(toIndentedString(realLastFour)).append("\n"); + sb.append(" trustedSource: ").append(toIndentedString(trustedSource)).append("\n"); sb.append("}"); return sb.toString(); } @@ -181,6 +208,7 @@ private String toIndentedString(Object o) { openapiFields.add("accountIdentifier"); openapiFields.add("id"); openapiFields.add("realLastFour"); + openapiFields.add("trustedSource"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/src/main/java/com/adyen/model/management/AllowedOriginsResponse.java b/src/main/java/com/adyen/model/management/AllowedOriginsResponse.java index ba72576a2..118ad568b 100644 --- a/src/main/java/com/adyen/model/management/AllowedOriginsResponse.java +++ b/src/main/java/com/adyen/model/management/AllowedOriginsResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { AllowedOrigin.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/AndroidAppsResponse.java b/src/main/java/com/adyen/model/management/AndroidAppsResponse.java index 01d2afe55..63d9d5b6a 100644 --- a/src/main/java/com/adyen/model/management/AndroidAppsResponse.java +++ b/src/main/java/com/adyen/model/management/AndroidAppsResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { AndroidApp.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/AndroidCertificatesResponse.java b/src/main/java/com/adyen/model/management/AndroidCertificatesResponse.java index c472e54f1..4d9d0344c 100644 --- a/src/main/java/com/adyen/model/management/AndroidCertificatesResponse.java +++ b/src/main/java/com/adyen/model/management/AndroidCertificatesResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { AndroidCertificate.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/ApiCredential.java b/src/main/java/com/adyen/model/management/ApiCredential.java index bef668456..14a371113 100644 --- a/src/main/java/com/adyen/model/management/ApiCredential.java +++ b/src/main/java/com/adyen/model/management/ApiCredential.java @@ -435,7 +435,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `allowedOrigins` (array) for (int i = 0; i < jsonArrayallowedOrigins.size(); i++) { AllowedOrigin.validateJsonObject(jsonArrayallowedOrigins.get(i).getAsJsonObject()); - }; + } } // validate the optional field clientKey if (jsonObj.get("clientKey") != null && !jsonObj.get("clientKey").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/management/BillingEntitiesResponse.java b/src/main/java/com/adyen/model/management/BillingEntitiesResponse.java index fa50389d0..3315956cd 100644 --- a/src/main/java/com/adyen/model/management/BillingEntitiesResponse.java +++ b/src/main/java/com/adyen/model/management/BillingEntitiesResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { BillingEntity.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/Company.java b/src/main/java/com/adyen/model/management/Company.java index 38988067b..77755a863 100644 --- a/src/main/java/com/adyen/model/management/Company.java +++ b/src/main/java/com/adyen/model/management/Company.java @@ -350,7 +350,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `dataCenters` (array) for (int i = 0; i < jsonArraydataCenters.size(); i++) { DataCenter.validateJsonObject(jsonArraydataCenters.get(i).getAsJsonObject()); - }; + } } // validate the optional field description if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/management/CompanyApiCredential.java b/src/main/java/com/adyen/model/management/CompanyApiCredential.java index b761be886..9a6b1008a 100644 --- a/src/main/java/com/adyen/model/management/CompanyApiCredential.java +++ b/src/main/java/com/adyen/model/management/CompanyApiCredential.java @@ -472,7 +472,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `allowedOrigins` (array) for (int i = 0; i < jsonArrayallowedOrigins.size(); i++) { AllowedOrigin.validateJsonObject(jsonArrayallowedOrigins.get(i).getAsJsonObject()); - }; + } } // ensure the json data is an array if (jsonObj.get("associatedMerchantAccounts") != null && !jsonObj.get("associatedMerchantAccounts").isJsonArray()) { diff --git a/src/main/java/com/adyen/model/management/CreateApiCredentialResponse.java b/src/main/java/com/adyen/model/management/CreateApiCredentialResponse.java index feca5f776..a9ab0ef2b 100644 --- a/src/main/java/com/adyen/model/management/CreateApiCredentialResponse.java +++ b/src/main/java/com/adyen/model/management/CreateApiCredentialResponse.java @@ -495,7 +495,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `allowedOrigins` (array) for (int i = 0; i < jsonArrayallowedOrigins.size(); i++) { AllowedOrigin.validateJsonObject(jsonArrayallowedOrigins.get(i).getAsJsonObject()); - }; + } } // validate the optional field apiKey if (jsonObj.get("apiKey") != null && !jsonObj.get("apiKey").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/management/CreateCompanyApiCredentialResponse.java b/src/main/java/com/adyen/model/management/CreateCompanyApiCredentialResponse.java index 1aa27d70c..0b65821c6 100644 --- a/src/main/java/com/adyen/model/management/CreateCompanyApiCredentialResponse.java +++ b/src/main/java/com/adyen/model/management/CreateCompanyApiCredentialResponse.java @@ -530,7 +530,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `allowedOrigins` (array) for (int i = 0; i < jsonArrayallowedOrigins.size(); i++) { AllowedOrigin.validateJsonObject(jsonArrayallowedOrigins.get(i).getAsJsonObject()); - }; + } } // validate the optional field apiKey if (jsonObj.get("apiKey") != null && !jsonObj.get("apiKey").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/management/EventUrl.java b/src/main/java/com/adyen/model/management/EventUrl.java index f2fd9b210..dff0cc97f 100644 --- a/src/main/java/com/adyen/model/management/EventUrl.java +++ b/src/main/java/com/adyen/model/management/EventUrl.java @@ -208,7 +208,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `eventLocalUrls` (array) for (int i = 0; i < jsonArrayeventLocalUrls.size(); i++) { Url.validateJsonObject(jsonArrayeventLocalUrls.get(i).getAsJsonObject()); - }; + } } JsonArray jsonArrayeventPublicUrls = jsonObj.getAsJsonArray("eventPublicUrls"); if (jsonArrayeventPublicUrls != null) { @@ -220,7 +220,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `eventPublicUrls` (array) for (int i = 0; i < jsonArrayeventPublicUrls.size(); i++) { Url.validateJsonObject(jsonArrayeventPublicUrls.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/JSONObject.java b/src/main/java/com/adyen/model/management/JSONObject.java index 8a9569fde..a9375c1db 100644 --- a/src/main/java/com/adyen/model/management/JSONObject.java +++ b/src/main/java/com/adyen/model/management/JSONObject.java @@ -200,7 +200,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `paths` (array) for (int i = 0; i < jsonArraypaths.size(); i++) { JSONPath.validateJsonObject(jsonArraypaths.get(i).getAsJsonObject()); - }; + } } // validate the optional field `rootPath` if (jsonObj.getAsJsonObject("rootPath") != null) { diff --git a/src/main/java/com/adyen/model/management/ListCompanyApiCredentialsResponse.java b/src/main/java/com/adyen/model/management/ListCompanyApiCredentialsResponse.java index df2d416bb..5fdddb27c 100644 --- a/src/main/java/com/adyen/model/management/ListCompanyApiCredentialsResponse.java +++ b/src/main/java/com/adyen/model/management/ListCompanyApiCredentialsResponse.java @@ -272,7 +272,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { CompanyApiCredential.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/ListCompanyResponse.java b/src/main/java/com/adyen/model/management/ListCompanyResponse.java index 2c6150613..6db204748 100644 --- a/src/main/java/com/adyen/model/management/ListCompanyResponse.java +++ b/src/main/java/com/adyen/model/management/ListCompanyResponse.java @@ -272,7 +272,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { Company.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/ListCompanyUsersResponse.java b/src/main/java/com/adyen/model/management/ListCompanyUsersResponse.java index 6cc7c17e5..463bdf01f 100644 --- a/src/main/java/com/adyen/model/management/ListCompanyUsersResponse.java +++ b/src/main/java/com/adyen/model/management/ListCompanyUsersResponse.java @@ -272,7 +272,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { CompanyUser.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/ListExternalTerminalActionsResponse.java b/src/main/java/com/adyen/model/management/ListExternalTerminalActionsResponse.java index 24968190b..5b29ca544 100644 --- a/src/main/java/com/adyen/model/management/ListExternalTerminalActionsResponse.java +++ b/src/main/java/com/adyen/model/management/ListExternalTerminalActionsResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { ExternalTerminalAction.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/ListMerchantApiCredentialsResponse.java b/src/main/java/com/adyen/model/management/ListMerchantApiCredentialsResponse.java index 152c9f906..98507e5bd 100644 --- a/src/main/java/com/adyen/model/management/ListMerchantApiCredentialsResponse.java +++ b/src/main/java/com/adyen/model/management/ListMerchantApiCredentialsResponse.java @@ -272,7 +272,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { ApiCredential.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/ListMerchantResponse.java b/src/main/java/com/adyen/model/management/ListMerchantResponse.java index e6e5479bb..2599bf8ce 100644 --- a/src/main/java/com/adyen/model/management/ListMerchantResponse.java +++ b/src/main/java/com/adyen/model/management/ListMerchantResponse.java @@ -272,7 +272,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { Merchant.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/ListMerchantUsersResponse.java b/src/main/java/com/adyen/model/management/ListMerchantUsersResponse.java index 4d446ea16..180b85b22 100644 --- a/src/main/java/com/adyen/model/management/ListMerchantUsersResponse.java +++ b/src/main/java/com/adyen/model/management/ListMerchantUsersResponse.java @@ -272,7 +272,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { User.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/ListStoresResponse.java b/src/main/java/com/adyen/model/management/ListStoresResponse.java index f38d3efd2..6a262c651 100644 --- a/src/main/java/com/adyen/model/management/ListStoresResponse.java +++ b/src/main/java/com/adyen/model/management/ListStoresResponse.java @@ -272,7 +272,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { Store.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/ListTerminalsResponse.java b/src/main/java/com/adyen/model/management/ListTerminalsResponse.java index 3e119b5a5..07d9bec49 100644 --- a/src/main/java/com/adyen/model/management/ListTerminalsResponse.java +++ b/src/main/java/com/adyen/model/management/ListTerminalsResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { Terminal.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/ListWebhooksResponse.java b/src/main/java/com/adyen/model/management/ListWebhooksResponse.java index a3dfa7d90..03e53b4c6 100644 --- a/src/main/java/com/adyen/model/management/ListWebhooksResponse.java +++ b/src/main/java/com/adyen/model/management/ListWebhooksResponse.java @@ -305,7 +305,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { Webhook.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/MeApiCredential.java b/src/main/java/com/adyen/model/management/MeApiCredential.java index 02f2f6aec..e37eea7c6 100644 --- a/src/main/java/com/adyen/model/management/MeApiCredential.java +++ b/src/main/java/com/adyen/model/management/MeApiCredential.java @@ -501,7 +501,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `allowedOrigins` (array) for (int i = 0; i < jsonArrayallowedOrigins.size(); i++) { AllowedOrigin.validateJsonObject(jsonArrayallowedOrigins.get(i).getAsJsonObject()); - }; + } } // ensure the json data is an array if (jsonObj.get("associatedMerchantAccounts") != null && !jsonObj.get("associatedMerchantAccounts").isJsonArray()) { diff --git a/src/main/java/com/adyen/model/management/Merchant.java b/src/main/java/com/adyen/model/management/Merchant.java index ee83df4ed..172be8769 100644 --- a/src/main/java/com/adyen/model/management/Merchant.java +++ b/src/main/java/com/adyen/model/management/Merchant.java @@ -561,7 +561,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `dataCenters` (array) for (int i = 0; i < jsonArraydataCenters.size(); i++) { DataCenter.validateJsonObject(jsonArraydataCenters.get(i).getAsJsonObject()); - }; + } } // validate the optional field defaultShopperInteraction if (jsonObj.get("defaultShopperInteraction") != null && !jsonObj.get("defaultShopperInteraction").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/management/ModelConfiguration.java b/src/main/java/com/adyen/model/management/ModelConfiguration.java index 982fb18aa..894f54ed8 100644 --- a/src/main/java/com/adyen/model/management/ModelConfiguration.java +++ b/src/main/java/com/adyen/model/management/ModelConfiguration.java @@ -247,7 +247,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `currencies` (array) for (int i = 0; i < jsonArraycurrencies.size(); i++) { Currency.validateJsonObject(jsonArraycurrencies.get(i).getAsJsonObject()); - }; + } } // ensure the json data is an array if (jsonObj.get("sources") != null && !jsonObj.get("sources").isJsonArray()) { diff --git a/src/main/java/com/adyen/model/management/NotificationUrl.java b/src/main/java/com/adyen/model/management/NotificationUrl.java index bb2c8ebc2..23f8e4fd4 100644 --- a/src/main/java/com/adyen/model/management/NotificationUrl.java +++ b/src/main/java/com/adyen/model/management/NotificationUrl.java @@ -208,7 +208,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `localUrls` (array) for (int i = 0; i < jsonArraylocalUrls.size(); i++) { Url.validateJsonObject(jsonArraylocalUrls.get(i).getAsJsonObject()); - }; + } } JsonArray jsonArraypublicUrls = jsonObj.getAsJsonArray("publicUrls"); if (jsonArraypublicUrls != null) { @@ -220,7 +220,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `publicUrls` (array) for (int i = 0; i < jsonArraypublicUrls.size(); i++) { Url.validateJsonObject(jsonArraypublicUrls.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/OfflineProcessing.java b/src/main/java/com/adyen/model/management/OfflineProcessing.java index a17bfeddb..183191c48 100644 --- a/src/main/java/com/adyen/model/management/OfflineProcessing.java +++ b/src/main/java/com/adyen/model/management/OfflineProcessing.java @@ -200,7 +200,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `offlineSwipeLimits` (array) for (int i = 0; i < jsonArrayofflineSwipeLimits.size(); i++) { MinorUnitsMonetaryValue.validateJsonObject(jsonArrayofflineSwipeLimits.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/PaymentMethodResponse.java b/src/main/java/com/adyen/model/management/PaymentMethodResponse.java index c718d069e..5454d7984 100644 --- a/src/main/java/com/adyen/model/management/PaymentMethodResponse.java +++ b/src/main/java/com/adyen/model/management/PaymentMethodResponse.java @@ -448,7 +448,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { PaymentMethod.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } // ensure the json data is an array if (jsonObj.get("typesWithErrors") != null && !jsonObj.get("typesWithErrors").isJsonArray()) { diff --git a/src/main/java/com/adyen/model/management/PayoutSettingsResponse.java b/src/main/java/com/adyen/model/management/PayoutSettingsResponse.java index 49dfe24d9..03bd165e0 100644 --- a/src/main/java/com/adyen/model/management/PayoutSettingsResponse.java +++ b/src/main/java/com/adyen/model/management/PayoutSettingsResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { PayoutSettings.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/RestServiceError.java b/src/main/java/com/adyen/model/management/RestServiceError.java index 6cd53592b..8d0460b78 100644 --- a/src/main/java/com/adyen/model/management/RestServiceError.java +++ b/src/main/java/com/adyen/model/management/RestServiceError.java @@ -428,7 +428,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `invalidFields` (array) for (int i = 0; i < jsonArrayinvalidFields.size(); i++) { InvalidField.validateJsonObject(jsonArrayinvalidFields.get(i).getAsJsonObject()); - }; + } } // validate the optional field requestId if (jsonObj.get("requestId") != null && !jsonObj.get("requestId").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsResponse.java b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsResponse.java index 9bc784f0d..1e293ecc1 100644 --- a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsResponse.java +++ b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsResponse.java @@ -399,7 +399,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `items` (array) for (int i = 0; i < jsonArrayitems.size(); i++) { TerminalActionScheduleDetail.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; + } } // validate the optional field scheduledAt if (jsonObj.get("scheduledAt") != null && !jsonObj.get("scheduledAt").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/management/ShippingLocationsResponse.java b/src/main/java/com/adyen/model/management/ShippingLocationsResponse.java index 4bd24d27a..24392f444 100644 --- a/src/main/java/com/adyen/model/management/ShippingLocationsResponse.java +++ b/src/main/java/com/adyen/model/management/ShippingLocationsResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { ShippingLocation.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/Surcharge.java b/src/main/java/com/adyen/model/management/Surcharge.java index 7f5b2c21d..5b5754b1d 100644 --- a/src/main/java/com/adyen/model/management/Surcharge.java +++ b/src/main/java/com/adyen/model/management/Surcharge.java @@ -200,7 +200,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `configurations` (array) for (int i = 0; i < jsonArrayconfigurations.size(); i++) { ModelConfiguration.validateJsonObject(jsonArrayconfigurations.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/TerminalModelsResponse.java b/src/main/java/com/adyen/model/management/TerminalModelsResponse.java index a4b306ede..e8ffd95ee 100644 --- a/src/main/java/com/adyen/model/management/TerminalModelsResponse.java +++ b/src/main/java/com/adyen/model/management/TerminalModelsResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { IdName.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/TerminalOrder.java b/src/main/java/com/adyen/model/management/TerminalOrder.java index 5dd147a7f..98da1691e 100644 --- a/src/main/java/com/adyen/model/management/TerminalOrder.java +++ b/src/main/java/com/adyen/model/management/TerminalOrder.java @@ -388,7 +388,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `items` (array) for (int i = 0; i < jsonArrayitems.size(); i++) { OrderItem.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; + } } // validate the optional field orderDate if (jsonObj.get("orderDate") != null && !jsonObj.get("orderDate").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/management/TerminalOrderRequest.java b/src/main/java/com/adyen/model/management/TerminalOrderRequest.java index 75487f819..dc55568d0 100644 --- a/src/main/java/com/adyen/model/management/TerminalOrderRequest.java +++ b/src/main/java/com/adyen/model/management/TerminalOrderRequest.java @@ -295,7 +295,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `items` (array) for (int i = 0; i < jsonArrayitems.size(); i++) { OrderItem.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); - }; + } } // validate the optional field shippingLocationId if (jsonObj.get("shippingLocationId") != null && !jsonObj.get("shippingLocationId").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/management/TerminalOrdersResponse.java b/src/main/java/com/adyen/model/management/TerminalOrdersResponse.java index 7b244c80f..a6f42feab 100644 --- a/src/main/java/com/adyen/model/management/TerminalOrdersResponse.java +++ b/src/main/java/com/adyen/model/management/TerminalOrdersResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { TerminalOrder.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/TerminalProductsResponse.java b/src/main/java/com/adyen/model/management/TerminalProductsResponse.java index 982fef2b3..afd538851 100644 --- a/src/main/java/com/adyen/model/management/TerminalProductsResponse.java +++ b/src/main/java/com/adyen/model/management/TerminalProductsResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { TerminalProduct.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/TerminalSettings.java b/src/main/java/com/adyen/model/management/TerminalSettings.java index 8d92a54e0..57e08ef5b 100644 --- a/src/main/java/com/adyen/model/management/TerminalSettings.java +++ b/src/main/java/com/adyen/model/management/TerminalSettings.java @@ -659,7 +659,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `gratuities` (array) for (int i = 0; i < jsonArraygratuities.size(); i++) { Gratuity.validateJsonObject(jsonArraygratuities.get(i).getAsJsonObject()); - }; + } } // validate the optional field `hardware` if (jsonObj.getAsJsonObject("hardware") != null) { diff --git a/src/main/java/com/adyen/model/management/TestWebhookResponse.java b/src/main/java/com/adyen/model/management/TestWebhookResponse.java index 4df423de6..1a6b67a7f 100644 --- a/src/main/java/com/adyen/model/management/TestWebhookResponse.java +++ b/src/main/java/com/adyen/model/management/TestWebhookResponse.java @@ -171,7 +171,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { TestOutput.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/management/WifiProfiles.java b/src/main/java/com/adyen/model/management/WifiProfiles.java index cb23acca5..d6554382c 100644 --- a/src/main/java/com/adyen/model/management/WifiProfiles.java +++ b/src/main/java/com/adyen/model/management/WifiProfiles.java @@ -201,7 +201,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `profiles` (array) for (int i = 0; i < jsonArrayprofiles.size(); i++) { Profile.validateJsonObject(jsonArrayprofiles.get(i).getAsJsonObject()); - }; + } } // validate the optional field `settings` if (jsonObj.getAsJsonObject("settings") != null) { diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataLodging.java b/src/main/java/com/adyen/model/payments/AdditionalDataLodging.java index 4b51f0e12..6b981bc43 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataLodging.java +++ b/src/main/java/com/adyen/model/payments/AdditionalDataLodging.java @@ -126,10 +126,10 @@ public AdditionalDataLodging lodgingCheckInDate(String lodgingCheckInDate) { } /** - * The arrival date. * Date format: `yyyyMMdd` + * The arrival date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. * @return lodgingCheckInDate **/ - @ApiModelProperty(value = "The arrival date. * Date format: `yyyyMMdd`") + @ApiModelProperty(value = "The arrival date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**.") public String getLodgingCheckInDate() { return lodgingCheckInDate; @@ -148,10 +148,10 @@ public AdditionalDataLodging lodgingCheckOutDate(String lodgingCheckOutDate) { } /** - * The departure date. * Date format: `yyyyMMdd` + * The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**. * @return lodgingCheckOutDate **/ - @ApiModelProperty(value = "The departure date. * Date format: `yyyyMMdd`") + @ApiModelProperty(value = "The departure date. * Date format: **yyyyMmDd**. For example, for 2023 April 22, **20230422**.") public String getLodgingCheckOutDate() { return lodgingCheckOutDate; @@ -170,10 +170,10 @@ public AdditionalDataLodging lodgingCustomerServiceTollFreeNumber(String lodging } /** - * The toll free phone number for the hotel/lodgings. * Format: Alphanumeric * maxLength: 17 + * The toll-free phone number for the lodging. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail. * @return lodgingCustomerServiceTollFreeNumber **/ - @ApiModelProperty(value = "The toll free phone number for the hotel/lodgings. * Format: Alphanumeric * maxLength: 17") + @ApiModelProperty(value = "The toll-free phone number for the lodging. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail.") public String getLodgingCustomerServiceTollFreeNumber() { return lodgingCustomerServiceTollFreeNumber; @@ -192,10 +192,10 @@ public AdditionalDataLodging lodgingFireSafetyActIndicator(String lodgingFireSaf } /** - * Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: Alphabetic * maxLength: 1 + * Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: alphabetic. * Max length: 1 character. * @return lodgingFireSafetyActIndicator **/ - @ApiModelProperty(value = "Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: Alphabetic * maxLength: 1") + @ApiModelProperty(value = "Identifies that the facility complies with the Hotel and Motel Fire Safety Act of 1990. Values can be: 'Y' or 'N'. * Format: alphabetic. * Max length: 1 character.") public String getLodgingFireSafetyActIndicator() { return lodgingFireSafetyActIndicator; @@ -214,10 +214,10 @@ public AdditionalDataLodging lodgingFolioCashAdvances(String lodgingFolioCashAdv } /** - * The folio cash advances. * Format: Numeric * maxLength: 12 + * The folio cash advances. * Format: numeric. * Max length: 12 characters. * @return lodgingFolioCashAdvances **/ - @ApiModelProperty(value = "The folio cash advances. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "The folio cash advances. * Format: numeric. * Max length: 12 characters.") public String getLodgingFolioCashAdvances() { return lodgingFolioCashAdvances; @@ -236,10 +236,10 @@ public AdditionalDataLodging lodgingFolioNumber(String lodgingFolioNumber) { } /** - * Card acceptor’s internal invoice or billing ID reference number. * Format: Alphanumeric * maxLength: 25 + * The card acceptor’s internal invoice or billing ID reference number. * Format: alphanumeric. * Max length: 25 characters. * @return lodgingFolioNumber **/ - @ApiModelProperty(value = "Card acceptor’s internal invoice or billing ID reference number. * Format: Alphanumeric * maxLength: 25") + @ApiModelProperty(value = "The card acceptor’s internal invoice or billing ID reference number. * Format: alphanumeric. * Max length: 25 characters.") public String getLodgingFolioNumber() { return lodgingFolioNumber; @@ -258,10 +258,10 @@ public AdditionalDataLodging lodgingFoodBeverageCharges(String lodgingFoodBevera } /** - * Any charges for food and beverages associated with the booking. * Format: Numeric * maxLength: 12 + * The additional charges for food and beverages associated with the booking. * Format: numeric. * Max length: 12 characters. * @return lodgingFoodBeverageCharges **/ - @ApiModelProperty(value = "Any charges for food and beverages associated with the booking. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "The additional charges for food and beverages associated with the booking. * Format: numeric. * Max length: 12 characters.") public String getLodgingFoodBeverageCharges() { return lodgingFoodBeverageCharges; @@ -280,10 +280,10 @@ public AdditionalDataLodging lodgingNoShowIndicator(String lodgingNoShowIndicato } /** - * Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). Value should be Y or N. * Format: Numeric * maxLength: 1 + * Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in. **N**: the customer checked in. * @return lodgingNoShowIndicator **/ - @ApiModelProperty(value = "Indicates if the customer was a \"no-show\" (neither keeps nor cancels their booking). Value should be Y or N. * Format: Numeric * maxLength: 1") + @ApiModelProperty(value = "Indicates if the customer didn't check in for their booking. Possible values: * **Y**: the customer didn't check in. **N**: the customer checked in.") public String getLodgingNoShowIndicator() { return lodgingNoShowIndicator; @@ -302,10 +302,10 @@ public AdditionalDataLodging lodgingPrepaidExpenses(String lodgingPrepaidExpense } /** - * Prepaid expenses for the booking. * Format: Numeric * maxLength: 12 + * The prepaid expenses for the booking. * Format: numeric. * Max length: 12 characters. * @return lodgingPrepaidExpenses **/ - @ApiModelProperty(value = "Prepaid expenses for the booking. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "The prepaid expenses for the booking. * Format: numeric. * Max length: 12 characters.") public String getLodgingPrepaidExpenses() { return lodgingPrepaidExpenses; @@ -324,10 +324,10 @@ public AdditionalDataLodging lodgingPropertyPhoneNumber(String lodgingPropertyPh } /** - * Identifies specific lodging property location by its local phone number. * Format: Alphanumeric * maxLength: 17 + * Identifies the location of the lodging by its local phone number. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail. * @return lodgingPropertyPhoneNumber **/ - @ApiModelProperty(value = "Identifies specific lodging property location by its local phone number. * Format: Alphanumeric * maxLength: 17") + @ApiModelProperty(value = "Identifies the location of the lodging by its local phone number. * Format: alphanumeric. * Max length: 17 characters. * For US numbers: must start with 3 digits and be at least 10 characters in length. Otherwise, the capture can fail.") public String getLodgingPropertyPhoneNumber() { return lodgingPropertyPhoneNumber; @@ -346,10 +346,10 @@ public AdditionalDataLodging lodgingRoom1NumberOfNights(String lodgingRoom1Numbe } /** - * Total number of nights the room will be rented. * Format: Numeric * maxLength: 4 + * The total number of nights the room is booked for. * Format: numeric. * Max length: 4 characters. * @return lodgingRoom1NumberOfNights **/ - @ApiModelProperty(value = "Total number of nights the room will be rented. * Format: Numeric * maxLength: 4") + @ApiModelProperty(value = "The total number of nights the room is booked for. * Format: numeric. * Max length: 4 characters.") public String getLodgingRoom1NumberOfNights() { return lodgingRoom1NumberOfNights; @@ -368,10 +368,10 @@ public AdditionalDataLodging lodgingRoom1Rate(String lodgingRoom1Rate) { } /** - * The rate of the room. * Format: Numeric * maxLength: 12 + * The rate of the room. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). * @return lodgingRoom1Rate **/ - @ApiModelProperty(value = "The rate of the room. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "The rate of the room. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes).") public String getLodgingRoom1Rate() { return lodgingRoom1Rate; @@ -390,10 +390,10 @@ public AdditionalDataLodging lodgingRoom1Tax(String lodgingRoom1Tax) { } /** - * The total amount of tax to be paid. * Format: Numeric * maxLength: 12 + * The total amount of tax to be paid. * Format: numeric. * Max length: 12 chracters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). * @return lodgingRoom1Tax **/ - @ApiModelProperty(value = "The total amount of tax to be paid. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "The total amount of tax to be paid. * Format: numeric. * Max length: 12 chracters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes).") public String getLodgingRoom1Tax() { return lodgingRoom1Tax; @@ -412,10 +412,10 @@ public AdditionalDataLodging lodgingTotalRoomTax(String lodgingTotalRoomTax) { } /** - * Total room tax amount. * Format: Numeric * maxLength: 12 + * The total room tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). * @return lodgingTotalRoomTax **/ - @ApiModelProperty(value = "Total room tax amount. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "The total room tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes).") public String getLodgingTotalRoomTax() { return lodgingTotalRoomTax; @@ -434,10 +434,10 @@ public AdditionalDataLodging lodgingTotalTax(String lodgingTotalTax) { } /** - * Total tax amount. * Format: Numeric * maxLength: 12 + * The total tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes). * @return lodgingTotalTax **/ - @ApiModelProperty(value = "Total tax amount. * Format: Numeric * maxLength: 12") + @ApiModelProperty(value = "The total tax amount. * Format: numeric. * Max length: 12 characters. * Must be in [minor units](https://docs.adyen.com/development-resources/currency-codes).") public String getLodgingTotalTax() { return lodgingTotalTax; @@ -456,10 +456,10 @@ public AdditionalDataLodging travelEntertainmentAuthDataDuration(String travelEn } /** - * Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2 + * The number of nights. This should be included in the auth message. * Format: numeric. * Max length: 2 characters. * @return travelEntertainmentAuthDataDuration **/ - @ApiModelProperty(value = "Number of nights. This should be included in the auth message. * Format: Numeric * maxLength: 2") + @ApiModelProperty(value = "The number of nights. This should be included in the auth message. * Format: numeric. * Max length: 2 characters.") public String getTravelEntertainmentAuthDataDuration() { return travelEntertainmentAuthDataDuration; @@ -478,10 +478,10 @@ public AdditionalDataLodging travelEntertainmentAuthDataMarket(String travelEnte } /** - * Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1 + * Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: alphanumeric. * Max length: 1 character. * @return travelEntertainmentAuthDataMarket **/ - @ApiModelProperty(value = "Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: Alphanumeric * maxLength: 1") + @ApiModelProperty(value = "Indicates what market-specific dataset will be submitted or is being submitted. Value should be \"H\" for Hotel. This should be included in the auth message. * Format: alphanumeric. * Max length: 1 character.") public String getTravelEntertainmentAuthDataMarket() { return travelEntertainmentAuthDataMarket; diff --git a/src/main/java/com/adyen/model/payments/AdjustAuthorisationRequest.java b/src/main/java/com/adyen/model/payments/AdjustAuthorisationRequest.java index 749c4127b..d5de8a4cf 100644 --- a/src/main/java/com/adyen/model/payments/AdjustAuthorisationRequest.java +++ b/src/main/java/com/adyen/model/payments/AdjustAuthorisationRequest.java @@ -512,7 +512,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field tenderReference if (jsonObj.get("tenderReference") != null && !jsonObj.get("tenderReference").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/payments/CancelRequest.java b/src/main/java/com/adyen/model/payments/CancelRequest.java index 8e02e2360..23a050e19 100644 --- a/src/main/java/com/adyen/model/payments/CancelRequest.java +++ b/src/main/java/com/adyen/model/payments/CancelRequest.java @@ -477,7 +477,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field tenderReference if (jsonObj.get("tenderReference") != null && !jsonObj.get("tenderReference").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/payments/CaptureRequest.java b/src/main/java/com/adyen/model/payments/CaptureRequest.java index 2a8b6285b..06be9dd73 100644 --- a/src/main/java/com/adyen/model/payments/CaptureRequest.java +++ b/src/main/java/com/adyen/model/payments/CaptureRequest.java @@ -512,7 +512,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field tenderReference if (jsonObj.get("tenderReference") != null && !jsonObj.get("tenderReference").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/payments/Card.java b/src/main/java/com/adyen/model/payments/Card.java index 16450be7b..9cf33d1b0 100644 --- a/src/main/java/com/adyen/model/payments/Card.java +++ b/src/main/java/com/adyen/model/payments/Card.java @@ -137,7 +137,7 @@ public Card expiryYear(String expiryYear) { * The card expiry year. Format: 4 digits. For example: 2020 * @return expiryYear **/ - @ApiModelProperty(required = true, value = "The card expiry year. Format: 4 digits. For example: 2020") + @ApiModelProperty(value = "The card expiry year. Format: 4 digits. For example: 2020") public String getExpiryYear() { return expiryYear; @@ -159,7 +159,7 @@ public Card holderName(String holderName) { * The name of the cardholder, as printed on the card. * @return holderName **/ - @ApiModelProperty(required = true, value = "The name of the cardholder, as printed on the card.") + @ApiModelProperty(value = "The name of the cardholder, as printed on the card.") public String getHolderName() { return holderName; @@ -329,8 +329,6 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("expiryYear"); - openapiRequiredFields.add("holderName"); } /** @@ -355,13 +353,6 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Card` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Card.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } // validate the optional field cvc if (jsonObj.get("cvc") != null && !jsonObj.get("cvc").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `cvc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvc").toString())); diff --git a/src/main/java/com/adyen/model/payments/FraudCheckResultWrapper.java b/src/main/java/com/adyen/model/payments/FraudCheckResultWrapper.java new file mode 100644 index 000000000..1fc6ceddb --- /dev/null +++ b/src/main/java/com/adyen/model/payments/FraudCheckResultWrapper.java @@ -0,0 +1,209 @@ +/* + * Adyen Payment API + * + * The version of the OpenAPI document: 68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.payments; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.payments.FraudCheckResult; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.payments.JSON; + +/** + * FraudCheckResultWrapper + */ + +public class FraudCheckResultWrapper { + public static final String SERIALIZED_NAME_FRAUD_CHECK_RESULT = "FraudCheckResult"; + @SerializedName(SERIALIZED_NAME_FRAUD_CHECK_RESULT) + private FraudCheckResult fraudCheckResult; + + public FraudCheckResultWrapper() { + } + + public FraudCheckResultWrapper fraudCheckResult(FraudCheckResult fraudCheckResult) { + + this.fraudCheckResult = fraudCheckResult; + return this; + } + + /** + * Get fraudCheckResult + * @return fraudCheckResult + **/ + @ApiModelProperty(value = "") + + public FraudCheckResult getFraudCheckResult() { + return fraudCheckResult; + } + + + public void setFraudCheckResult(FraudCheckResult fraudCheckResult) { + this.fraudCheckResult = fraudCheckResult; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FraudCheckResultWrapper fraudCheckResultWrapper = (FraudCheckResultWrapper) o; + return Objects.equals(this.fraudCheckResult, fraudCheckResultWrapper.fraudCheckResult); + } + + @Override + public int hashCode() { + return Objects.hash(fraudCheckResult); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FraudCheckResultWrapper {\n"); + sb.append(" fraudCheckResult: ").append(toIndentedString(fraudCheckResult)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("FraudCheckResult"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FraudCheckResultWrapper + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FraudCheckResultWrapper.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FraudCheckResultWrapper is not found in the empty JSON string", FraudCheckResultWrapper.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FraudCheckResultWrapper.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FraudCheckResultWrapper` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `FraudCheckResult` + if (jsonObj.getAsJsonObject("FraudCheckResult") != null) { + FraudCheckResult.validateJsonObject(jsonObj.getAsJsonObject("FraudCheckResult")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FraudCheckResultWrapper.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FraudCheckResultWrapper' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FraudCheckResultWrapper.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FraudCheckResultWrapper value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FraudCheckResultWrapper read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FraudCheckResultWrapper given an JSON string + * + * @param jsonString JSON string + * @return An instance of FraudCheckResultWrapper + * @throws IOException if the JSON string is invalid with respect to FraudCheckResultWrapper + */ + public static FraudCheckResultWrapper fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FraudCheckResultWrapper.class); + } + + /** + * Convert an instance of FraudCheckResultWrapper to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/payments/FraudResult.java b/src/main/java/com/adyen/model/payments/FraudResult.java index 5b10501d0..1a6956a85 100644 --- a/src/main/java/com/adyen/model/payments/FraudResult.java +++ b/src/main/java/com/adyen/model/payments/FraudResult.java @@ -14,7 +14,7 @@ import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.FraudCheckResult; +import com.adyen.model.payments.FraudCheckResultWrapper; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -57,7 +57,7 @@ public class FraudResult { public static final String SERIALIZED_NAME_RESULTS = "results"; @SerializedName(SERIALIZED_NAME_RESULTS) - private List results = null; + private List results = null; public FraudResult() { } @@ -84,13 +84,13 @@ public void setAccountScore(Integer accountScore) { } - public FraudResult results(List results) { + public FraudResult results(List results) { this.results = results; return this; } - public FraudResult addResultsItem(FraudCheckResult resultsItem) { + public FraudResult addResultsItem(FraudCheckResultWrapper resultsItem) { if (this.results == null) { this.results = new ArrayList<>(); } @@ -104,12 +104,12 @@ public FraudResult addResultsItem(FraudCheckResult resultsItem) { **/ @ApiModelProperty(value = "The result of the individual risk checks.") - public List getResults() { + public List getResults() { return results; } - public void setResults(List results) { + public void setResults(List results) { this.results = results; } @@ -207,8 +207,8 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `results` (array) for (int i = 0; i < jsonArrayresults.size(); i++) { - FraudCheckResult.validateJsonObject(jsonArrayresults.get(i).getAsJsonObject()); - }; + FraudCheckResultWrapper.validateJsonObject(jsonArrayresults.get(i).getAsJsonObject()); + } } } diff --git a/src/main/java/com/adyen/model/payments/JSON.java b/src/main/java/com/adyen/model/payments/JSON.java index f6ea3ea39..ea27d6b53 100644 --- a/src/main/java/com/adyen/model/payments/JSON.java +++ b/src/main/java/com/adyen/model/payments/JSON.java @@ -128,6 +128,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ExternalPlatform.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ForexQuote.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.FraudCheckResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.FraudCheckResultWrapper.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.FraudResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.FundDestination.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.FundSource.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/adyen/model/payments/PaymentRequest.java b/src/main/java/com/adyen/model/payments/PaymentRequest.java index b65a79435..75d4fff65 100644 --- a/src/main/java/com/adyen/model/payments/PaymentRequest.java +++ b/src/main/java/com/adyen/model/payments/PaymentRequest.java @@ -298,7 +298,7 @@ public FundingSourceEnum read(final JsonReader jsonReader) throws IOException { private Recurring recurring; /** - * Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. */ @JsonAdapter(RecurringProcessingModelEnum.Adapter.class) public enum RecurringProcessingModelEnum { @@ -965,10 +965,10 @@ public PaymentRequest putLocalizedShopperStatementItem(String key, String locali } /** - * This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. * @return localizedShopperStatement **/ - @ApiModelProperty(value = "This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned.") + @ApiModelProperty(value = "This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions.") public Map getLocalizedShopperStatement() { return localizedShopperStatement; @@ -1237,10 +1237,10 @@ public PaymentRequest recurringProcessingModel(RecurringProcessingModelEnum recu } /** - * Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. * @return recurringProcessingModel **/ - @ApiModelProperty(value = "Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. ") + @ApiModelProperty(value = "Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. ") public RecurringProcessingModelEnum getRecurringProcessingModel() { return recurringProcessingModel; @@ -2095,7 +2095,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field store if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/payments/PaymentRequest3d.java b/src/main/java/com/adyen/model/payments/PaymentRequest3d.java index acf100ade..3df0150f6 100644 --- a/src/main/java/com/adyen/model/payments/PaymentRequest3d.java +++ b/src/main/java/com/adyen/model/payments/PaymentRequest3d.java @@ -167,7 +167,7 @@ public class PaymentRequest3d { private Recurring recurring; /** - * Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. */ @JsonAdapter(RecurringProcessingModelEnum.Adapter.class) public enum RecurringProcessingModelEnum { @@ -702,10 +702,10 @@ public PaymentRequest3d putLocalizedShopperStatementItem(String key, String loca } /** - * This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. * @return localizedShopperStatement **/ - @ApiModelProperty(value = "This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned.") + @ApiModelProperty(value = "This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions.") public Map getLocalizedShopperStatement() { return localizedShopperStatement; @@ -930,10 +930,10 @@ public PaymentRequest3d recurringProcessingModel(RecurringProcessingModelEnum re } /** - * Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. * @return recurringProcessingModel **/ - @ApiModelProperty(value = "Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. ") + @ApiModelProperty(value = "Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. ") public RecurringProcessingModelEnum getRecurringProcessingModel() { return recurringProcessingModel; @@ -1726,7 +1726,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field store if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/payments/PaymentRequest3ds2.java b/src/main/java/com/adyen/model/payments/PaymentRequest3ds2.java index 4f8a17b54..3be027097 100644 --- a/src/main/java/com/adyen/model/payments/PaymentRequest3ds2.java +++ b/src/main/java/com/adyen/model/payments/PaymentRequest3ds2.java @@ -160,7 +160,7 @@ public class PaymentRequest3ds2 { private Recurring recurring; /** - * Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. */ @JsonAdapter(RecurringProcessingModelEnum.Adapter.class) public enum RecurringProcessingModelEnum { @@ -703,10 +703,10 @@ public PaymentRequest3ds2 putLocalizedShopperStatementItem(String key, String lo } /** - * This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. + * This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions. * @return localizedShopperStatement **/ - @ApiModelProperty(value = "This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned.") + @ApiModelProperty(value = "This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions.") public Map getLocalizedShopperStatement() { return localizedShopperStatement; @@ -887,10 +887,10 @@ public PaymentRequest3ds2 recurringProcessingModel(RecurringProcessingModelEnum } /** - * Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + * Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. * @return recurringProcessingModel **/ - @ApiModelProperty(value = "Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. ") + @ApiModelProperty(value = "Defines a recurring payment type. Required when creating a token to store payment details or using stored payment details. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. ") public RecurringProcessingModelEnum getRecurringProcessingModel() { return recurringProcessingModel; @@ -1719,7 +1719,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field store if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/payments/PlatformChargebackLogic.java b/src/main/java/com/adyen/model/payments/PlatformChargebackLogic.java index bd7898f50..0aac5a774 100644 --- a/src/main/java/com/adyen/model/payments/PlatformChargebackLogic.java +++ b/src/main/java/com/adyen/model/payments/PlatformChargebackLogic.java @@ -101,6 +101,10 @@ public BehaviorEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_BEHAVIOR) private BehaviorEnum behavior; + public static final String SERIALIZED_NAME_COST_ALLOCATION_ACCOUNT = "costAllocationAccount"; + @SerializedName(SERIALIZED_NAME_COST_ALLOCATION_ACCOUNT) + private String costAllocationAccount; + public static final String SERIALIZED_NAME_TARGET_ACCOUNT = "targetAccount"; @SerializedName(SERIALIZED_NAME_TARGET_ACCOUNT) private String targetAccount; @@ -130,6 +134,28 @@ public void setBehavior(BehaviorEnum behavior) { } + public PlatformChargebackLogic costAllocationAccount(String costAllocationAccount) { + + this.costAllocationAccount = costAllocationAccount; + return this; + } + + /** + * Get costAllocationAccount + * @return costAllocationAccount + **/ + @ApiModelProperty(value = "") + + public String getCostAllocationAccount() { + return costAllocationAccount; + } + + + public void setCostAllocationAccount(String costAllocationAccount) { + this.costAllocationAccount = costAllocationAccount; + } + + public PlatformChargebackLogic targetAccount(String targetAccount) { this.targetAccount = targetAccount; @@ -163,12 +189,13 @@ public boolean equals(Object o) { } PlatformChargebackLogic platformChargebackLogic = (PlatformChargebackLogic) o; return Objects.equals(this.behavior, platformChargebackLogic.behavior) && + Objects.equals(this.costAllocationAccount, platformChargebackLogic.costAllocationAccount) && Objects.equals(this.targetAccount, platformChargebackLogic.targetAccount); } @Override public int hashCode() { - return Objects.hash(behavior, targetAccount); + return Objects.hash(behavior, costAllocationAccount, targetAccount); } @Override @@ -176,6 +203,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PlatformChargebackLogic {\n"); sb.append(" behavior: ").append(toIndentedString(behavior)).append("\n"); + sb.append(" costAllocationAccount: ").append(toIndentedString(costAllocationAccount)).append("\n"); sb.append(" targetAccount: ").append(toIndentedString(targetAccount)).append("\n"); sb.append("}"); return sb.toString(); @@ -200,6 +228,7 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("behavior"); + openapiFields.add("costAllocationAccount"); openapiFields.add("targetAccount"); // a set of required properties/fields (JSON key names) @@ -235,6 +264,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } BehaviorEnum.fromValue(jsonObj.get("behavior").getAsString()); } + // validate the optional field costAllocationAccount + if (jsonObj.get("costAllocationAccount") != null && !jsonObj.get("costAllocationAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `costAllocationAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("costAllocationAccount").toString())); + } // validate the optional field targetAccount if (jsonObj.get("targetAccount") != null && !jsonObj.get("targetAccount").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `targetAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("targetAccount").toString())); diff --git a/src/main/java/com/adyen/model/payments/RefundRequest.java b/src/main/java/com/adyen/model/payments/RefundRequest.java index 8700052ed..3123a9ce6 100644 --- a/src/main/java/com/adyen/model/payments/RefundRequest.java +++ b/src/main/java/com/adyen/model/payments/RefundRequest.java @@ -512,7 +512,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field tenderReference if (jsonObj.get("tenderReference") != null && !jsonObj.get("tenderReference").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/payments/TechnicalCancelRequest.java b/src/main/java/com/adyen/model/payments/TechnicalCancelRequest.java index e8dbee9b9..28bcc0406 100644 --- a/src/main/java/com/adyen/model/payments/TechnicalCancelRequest.java +++ b/src/main/java/com/adyen/model/payments/TechnicalCancelRequest.java @@ -478,7 +478,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field tenderReference if (jsonObj.get("tenderReference") != null && !jsonObj.get("tenderReference").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/payments/VoidPendingRefundRequest.java b/src/main/java/com/adyen/model/payments/VoidPendingRefundRequest.java index e7d7baad5..34dee6c93 100644 --- a/src/main/java/com/adyen/model/payments/VoidPendingRefundRequest.java +++ b/src/main/java/com/adyen/model/payments/VoidPendingRefundRequest.java @@ -510,7 +510,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `splits` (array) for (int i = 0; i < jsonArraysplits.size(); i++) { Split.validateJsonObject(jsonArraysplits.get(i).getAsJsonObject()); - }; + } } // validate the optional field tenderReference if (jsonObj.get("tenderReference") != null && !jsonObj.get("tenderReference").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/payout/FraudResult.java b/src/main/java/com/adyen/model/payout/FraudResult.java index 7b0c8a137..5f810b037 100644 --- a/src/main/java/com/adyen/model/payout/FraudResult.java +++ b/src/main/java/com/adyen/model/payout/FraudResult.java @@ -208,7 +208,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `results` (array) for (int i = 0; i < jsonArrayresults.size(); i++) { FraudCheckResultWrapper.validateJsonObject(jsonArrayresults.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/recurring/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/recurring/AbstractOpenApiSchema.java index a85f12092..df4fbb1f5 100644 --- a/src/main/java/com/adyen/model/recurring/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/recurring/AbstractOpenApiSchema.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/Address.java b/src/main/java/com/adyen/model/recurring/Address.java index 62ca6b7a7..5780509a7 100644 --- a/src/main/java/com/adyen/model/recurring/Address.java +++ b/src/main/java/com/adyen/model/recurring/Address.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/Amount.java b/src/main/java/com/adyen/model/recurring/Amount.java index f5b0796ae..5118e6efe 100644 --- a/src/main/java/com/adyen/model/recurring/Amount.java +++ b/src/main/java/com/adyen/model/recurring/Amount.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/BankAccount.java b/src/main/java/com/adyen/model/recurring/BankAccount.java index ff2f7f2f7..62097a47e 100644 --- a/src/main/java/com/adyen/model/recurring/BankAccount.java +++ b/src/main/java/com/adyen/model/recurring/BankAccount.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/Card.java b/src/main/java/com/adyen/model/recurring/Card.java index 15b469913..744b7dc29 100644 --- a/src/main/java/com/adyen/model/recurring/Card.java +++ b/src/main/java/com/adyen/model/recurring/Card.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/CreatePermitRequest.java b/src/main/java/com/adyen/model/recurring/CreatePermitRequest.java index 2e6cea6b2..af5977e5e 100644 --- a/src/main/java/com/adyen/model/recurring/CreatePermitRequest.java +++ b/src/main/java/com/adyen/model/recurring/CreatePermitRequest.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -270,7 +271,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `permits` (array) for (int i = 0; i < jsonArraypermits.size(); i++) { Permit.validateJsonObject(jsonArraypermits.get(i).getAsJsonObject()); - }; + } } // validate the optional field recurringDetailReference if (jsonObj.get("recurringDetailReference") != null && !jsonObj.get("recurringDetailReference").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/recurring/CreatePermitResult.java b/src/main/java/com/adyen/model/recurring/CreatePermitResult.java index f2f33f423..ee400416f 100644 --- a/src/main/java/com/adyen/model/recurring/CreatePermitResult.java +++ b/src/main/java/com/adyen/model/recurring/CreatePermitResult.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -200,7 +201,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `permitResultList` (array) for (int i = 0; i < jsonArraypermitResultList.size(); i++) { PermitResult.validateJsonObject(jsonArraypermitResultList.get(i).getAsJsonObject()); - }; + } } // validate the optional field pspReference if (jsonObj.get("pspReference") != null && !jsonObj.get("pspReference").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java b/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java index 0f2efb2bc..3da2bf98d 100644 --- a/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java +++ b/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/DisablePermitResult.java b/src/main/java/com/adyen/model/recurring/DisablePermitResult.java index 1de995263..ad8c8d793 100644 --- a/src/main/java/com/adyen/model/recurring/DisablePermitResult.java +++ b/src/main/java/com/adyen/model/recurring/DisablePermitResult.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/DisableRequest.java b/src/main/java/com/adyen/model/recurring/DisableRequest.java index a94318afe..74302b217 100644 --- a/src/main/java/com/adyen/model/recurring/DisableRequest.java +++ b/src/main/java/com/adyen/model/recurring/DisableRequest.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/DisableResult.java b/src/main/java/com/adyen/model/recurring/DisableResult.java index 2658c9d46..b5b0d27d6 100644 --- a/src/main/java/com/adyen/model/recurring/DisableResult.java +++ b/src/main/java/com/adyen/model/recurring/DisableResult.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/JSON.java b/src/main/java/com/adyen/model/recurring/JSON.java index 980639353..566a7199a 100644 --- a/src/main/java/com/adyen/model/recurring/JSON.java +++ b/src/main/java/com/adyen/model/recurring/JSON.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/Name.java b/src/main/java/com/adyen/model/recurring/Name.java index d53395795..f9c33f0b3 100644 --- a/src/main/java/com/adyen/model/recurring/Name.java +++ b/src/main/java/com/adyen/model/recurring/Name.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/NotifyShopperRequest.java b/src/main/java/com/adyen/model/recurring/NotifyShopperRequest.java index 214775ec9..f38c10fbc 100644 --- a/src/main/java/com/adyen/model/recurring/NotifyShopperRequest.java +++ b/src/main/java/com/adyen/model/recurring/NotifyShopperRequest.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java b/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java index c133b2dd2..23b2e91de 100644 --- a/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java +++ b/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/Permit.java b/src/main/java/com/adyen/model/recurring/Permit.java index 02c33debb..e9610bae1 100644 --- a/src/main/java/com/adyen/model/recurring/Permit.java +++ b/src/main/java/com/adyen/model/recurring/Permit.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/PermitRestriction.java b/src/main/java/com/adyen/model/recurring/PermitRestriction.java index b2dcc6103..fa4fbdd59 100644 --- a/src/main/java/com/adyen/model/recurring/PermitRestriction.java +++ b/src/main/java/com/adyen/model/recurring/PermitRestriction.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/PermitResult.java b/src/main/java/com/adyen/model/recurring/PermitResult.java index 0f3acfc13..23135fa4c 100644 --- a/src/main/java/com/adyen/model/recurring/PermitResult.java +++ b/src/main/java/com/adyen/model/recurring/PermitResult.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/Recurring.java b/src/main/java/com/adyen/model/recurring/Recurring.java index c932a674c..1501dc994 100644 --- a/src/main/java/com/adyen/model/recurring/Recurring.java +++ b/src/main/java/com/adyen/model/recurring/Recurring.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetail.java b/src/main/java/com/adyen/model/recurring/RecurringDetail.java index e1e769958..517a54a3d 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetail.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetail.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java b/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java index 032f47611..e58c82ec3 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java b/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java index 399f57543..2c452000e 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java b/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java index f0188d938..70a49a753 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -259,7 +260,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `details` (array) for (int i = 0; i < jsonArraydetails.size(); i++) { RecurringDetailWrapper.validateJsonObject(jsonArraydetails.get(i).getAsJsonObject()); - }; + } } // validate the optional field lastKnownShopperEmail if (jsonObj.get("lastKnownShopperEmail") != null && !jsonObj.get("lastKnownShopperEmail").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java index 4d691fbd6..78bbaee58 100644 --- a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java +++ b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java index b81fc142c..f0c0de60b 100644 --- a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java +++ b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/ServiceError.java b/src/main/java/com/adyen/model/recurring/ServiceError.java index 79c1e28d1..f833159cd 100644 --- a/src/main/java/com/adyen/model/recurring/ServiceError.java +++ b/src/main/java/com/adyen/model/recurring/ServiceError.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/recurring/TokenDetails.java b/src/main/java/com/adyen/model/recurring/TokenDetails.java index bae8683b4..2f04aa89d 100644 --- a/src/main/java/com/adyen/model/recurring/TokenDetails.java +++ b/src/main/java/com/adyen/model/recurring/TokenDetails.java @@ -1,5 +1,6 @@ /* * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/model/transfers/Address2.java b/src/main/java/com/adyen/model/transfers/Address2.java index 5dfdea944..bd6ed7bcf 100644 --- a/src/main/java/com/adyen/model/transfers/Address2.java +++ b/src/main/java/com/adyen/model/transfers/Address2.java @@ -104,10 +104,10 @@ public Address2 country(String country) { } /** - * The two-character ISO 3166-1 alpha-2 country code. For example, **US**. >If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + * The two-character ISO 3166-1 alpha-2 country code. For example, **US**, **NL**, or **GB**. * @return country **/ - @ApiModelProperty(required = true, value = "The two-character ISO 3166-1 alpha-2 country code. For example, **US**. >If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`.") + @ApiModelProperty(required = true, value = "The two-character ISO 3166-1 alpha-2 country code. For example, **US**, **NL**, or **GB**.") public String getCountry() { return country; diff --git a/src/main/java/com/adyen/model/transfers/JSON.java b/src/main/java/com/adyen/model/transfers/JSON.java index 29e12a9ef..92d18adb6 100644 --- a/src/main/java/com/adyen/model/transfers/JSON.java +++ b/src/main/java/com/adyen/model/transfers/JSON.java @@ -117,6 +117,8 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transfers.NumberAndBicAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transfers.PLLocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transfers.PartyIdentification2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transfers.PaymentInstrument.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transfers.ResourceReference.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transfers.RestServiceError.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transfers.SELocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transfers.SGLocalAccountIdentification.CustomTypeAdapterFactory()); @@ -126,6 +128,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transfers.TransferInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transfers.UKLocalAccountIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transfers.USLocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transfers.UltimatePartyIdentification.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } diff --git a/src/main/java/com/adyen/model/transfers/JSONObject.java b/src/main/java/com/adyen/model/transfers/JSONObject.java index e2770bf89..b649f74d2 100644 --- a/src/main/java/com/adyen/model/transfers/JSONObject.java +++ b/src/main/java/com/adyen/model/transfers/JSONObject.java @@ -200,7 +200,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `paths` (array) for (int i = 0; i < jsonArraypaths.size(); i++) { JSONPath.validateJsonObject(jsonArraypaths.get(i).getAsJsonObject()); - }; + } } // validate the optional field `rootPath` if (jsonObj.getAsJsonObject("rootPath") != null) { diff --git a/src/main/java/com/adyen/model/transfers/PartyIdentification2.java b/src/main/java/com/adyen/model/transfers/PartyIdentification2.java index 9ce8f5703..0d007dab9 100644 --- a/src/main/java/com/adyen/model/transfers/PartyIdentification2.java +++ b/src/main/java/com/adyen/model/transfers/PartyIdentification2.java @@ -70,6 +70,10 @@ public class PartyIdentification2 { @SerializedName(SERIALIZED_NAME_LAST_NAME) private String lastName; + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; + /** * The type of entity that owns the bank account. Possible values: **individual**, **organization**, or **unknown**. */ @@ -155,10 +159,10 @@ public PartyIdentification2 dateOfBirth(LocalDate dateOfBirth) { } /** - * The date of birth of the individual. Format: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD Allowed only when `type` is **individual**. + * The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**. Allowed only when `type` is **individual**. * @return dateOfBirth **/ - @ApiModelProperty(value = "The date of birth of the individual. Format: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD Allowed only when `type` is **individual**.") + @ApiModelProperty(value = "The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**. Allowed only when `type` is **individual**.") public LocalDate getDateOfBirth() { return dateOfBirth; @@ -177,10 +181,10 @@ public PartyIdentification2 firstName(String firstName) { } /** - * First name of the individual. Allowed only when `type` is **individual**. + * First name of the individual. Allowed only when `type` is **individual**. * @return firstName **/ - @ApiModelProperty(value = "First name of the individual. Allowed only when `type` is **individual**.") + @ApiModelProperty(value = "First name of the individual. Allowed only when `type` is **individual**.") public String getFirstName() { return firstName; @@ -221,10 +225,10 @@ public PartyIdentification2 lastName(String lastName) { } /** - * Last name of the individual. Allowed only when `type` is **individual**. + * Last name of the individual. Allowed only when `type` is **individual**. * @return lastName **/ - @ApiModelProperty(value = "Last name of the individual. Allowed only when `type` is **individual**.") + @ApiModelProperty(value = "Last name of the individual. Allowed only when `type` is **individual**.") public String getLastName() { return lastName; @@ -236,6 +240,28 @@ public void setLastName(String lastName) { } + public PartyIdentification2 reference(String reference) { + + this.reference = reference; + return this; + } + + /** + * Your unique reference of the party. This should be consistent for all transfers initiated to/from the same party/counterparty. e.g Your client's unique wallet or payee ID + * @return reference + **/ + @ApiModelProperty(value = "Your unique reference of the party. This should be consistent for all transfers initiated to/from the same party/counterparty. e.g Your client's unique wallet or payee ID") + + public String getReference() { + return reference; + } + + + public void setReference(String reference) { + this.reference = reference; + } + + public PartyIdentification2 type(TypeEnum type) { this.type = type; @@ -273,12 +299,13 @@ public boolean equals(Object o) { Objects.equals(this.firstName, partyIdentification2.firstName) && Objects.equals(this.fullName, partyIdentification2.fullName) && Objects.equals(this.lastName, partyIdentification2.lastName) && + Objects.equals(this.reference, partyIdentification2.reference) && Objects.equals(this.type, partyIdentification2.type); } @Override public int hashCode() { - return Objects.hash(address, dateOfBirth, firstName, fullName, lastName, type); + return Objects.hash(address, dateOfBirth, firstName, fullName, lastName, reference, type); } @Override @@ -290,6 +317,7 @@ public String toString() { sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); @@ -318,6 +346,7 @@ private String toIndentedString(Object o) { openapiFields.add("firstName"); openapiFields.add("fullName"); openapiFields.add("lastName"); + openapiFields.add("reference"); openapiFields.add("type"); // a set of required properties/fields (JSON key names) @@ -370,6 +399,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("lastName") != null && !jsonObj.get("lastName").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString())); } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } // ensure the field type can be parsed to an enum value if (jsonObj.get("type") != null) { if(!jsonObj.get("type").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/transfers/PaymentInstrument.java b/src/main/java/com/adyen/model/transfers/PaymentInstrument.java new file mode 100644 index 000000000..60eb0ddee --- /dev/null +++ b/src/main/java/com/adyen/model/transfers/PaymentInstrument.java @@ -0,0 +1,307 @@ +/* + * Transfers API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.transfers; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.transfers.JSON; + +/** + * PaymentInstrument + */ + +public class PaymentInstrument { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; + + public static final String SERIALIZED_NAME_TOKEN_TYPE = "tokenType"; + @SerializedName(SERIALIZED_NAME_TOKEN_TYPE) + private String tokenType; + + public PaymentInstrument() { + } + + public PaymentInstrument description(String description) { + + this.description = description; + return this; + } + + /** + * The description of the resource. + * @return description + **/ + @ApiModelProperty(value = "The description of the resource.") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public PaymentInstrument id(String id) { + + this.id = id; + return this; + } + + /** + * The unique identifier of the resource. + * @return id + **/ + @ApiModelProperty(value = "The unique identifier of the resource.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public PaymentInstrument reference(String reference) { + + this.reference = reference; + return this; + } + + /** + * The reference for the resource. + * @return reference + **/ + @ApiModelProperty(value = "The reference for the resource.") + + public String getReference() { + return reference; + } + + + public void setReference(String reference) { + this.reference = reference; + } + + + public PaymentInstrument tokenType(String tokenType) { + + this.tokenType = tokenType; + return this; + } + + /** + * The type of wallet the network token is associated with. + * @return tokenType + **/ + @ApiModelProperty(value = "The type of wallet the network token is associated with.") + + public String getTokenType() { + return tokenType; + } + + + public void setTokenType(String tokenType) { + this.tokenType = tokenType; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentInstrument paymentInstrument = (PaymentInstrument) o; + return Objects.equals(this.description, paymentInstrument.description) && + Objects.equals(this.id, paymentInstrument.id) && + Objects.equals(this.reference, paymentInstrument.reference) && + Objects.equals(this.tokenType, paymentInstrument.tokenType); + } + + @Override + public int hashCode() { + return Objects.hash(description, id, reference, tokenType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentInstrument {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("description"); + openapiFields.add("id"); + openapiFields.add("reference"); + openapiFields.add("tokenType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PaymentInstrument + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PaymentInstrument.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PaymentInstrument is not found in the empty JSON string", PaymentInstrument.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PaymentInstrument.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrument` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field description + if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + // validate the optional field tokenType + if (jsonObj.get("tokenType") != null && !jsonObj.get("tokenType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tokenType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PaymentInstrument.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PaymentInstrument' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PaymentInstrument.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PaymentInstrument value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PaymentInstrument read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PaymentInstrument given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentInstrument + * @throws IOException if the JSON string is invalid with respect to PaymentInstrument + */ + public static PaymentInstrument fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PaymentInstrument.class); + } + + /** + * Convert an instance of PaymentInstrument to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transfers/ResourceReference.java b/src/main/java/com/adyen/model/transfers/ResourceReference.java new file mode 100644 index 000000000..e33d075f4 --- /dev/null +++ b/src/main/java/com/adyen/model/transfers/ResourceReference.java @@ -0,0 +1,274 @@ +/* + * Transfers API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.transfers; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.transfers.JSON; + +/** + * ResourceReference + */ + +public class ResourceReference { + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; + + public ResourceReference() { + } + + public ResourceReference description(String description) { + + this.description = description; + return this; + } + + /** + * The description of the resource. + * @return description + **/ + @ApiModelProperty(value = "The description of the resource.") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public ResourceReference id(String id) { + + this.id = id; + return this; + } + + /** + * The unique identifier of the resource. + * @return id + **/ + @ApiModelProperty(value = "The unique identifier of the resource.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public ResourceReference reference(String reference) { + + this.reference = reference; + return this; + } + + /** + * The reference for the resource. + * @return reference + **/ + @ApiModelProperty(value = "The reference for the resource.") + + public String getReference() { + return reference; + } + + + public void setReference(String reference) { + this.reference = reference; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResourceReference resourceReference = (ResourceReference) o; + return Objects.equals(this.description, resourceReference.description) && + Objects.equals(this.id, resourceReference.id) && + Objects.equals(this.reference, resourceReference.reference); + } + + @Override + public int hashCode() { + return Objects.hash(description, id, reference); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResourceReference {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("description"); + openapiFields.add("id"); + openapiFields.add("reference"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ResourceReference + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ResourceReference.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ResourceReference is not found in the empty JSON string", ResourceReference.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ResourceReference.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResourceReference` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field description + if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ResourceReference.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResourceReference' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResourceReference.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ResourceReference value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ResourceReference read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResourceReference given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResourceReference + * @throws IOException if the JSON string is invalid with respect to ResourceReference + */ + public static ResourceReference fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResourceReference.class); + } + + /** + * Convert an instance of ResourceReference to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transfers/RestServiceError.java b/src/main/java/com/adyen/model/transfers/RestServiceError.java index 0ab11385f..4b4deb6c7 100644 --- a/src/main/java/com/adyen/model/transfers/RestServiceError.java +++ b/src/main/java/com/adyen/model/transfers/RestServiceError.java @@ -428,7 +428,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `invalidFields` (array) for (int i = 0; i < jsonArrayinvalidFields.size(); i++) { InvalidField.validateJsonObject(jsonArrayinvalidFields.get(i).getAsJsonObject()); - }; + } } // validate the optional field requestId if (jsonObj.get("requestId") != null && !jsonObj.get("requestId").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java b/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java index 1c9381158..a65fac238 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java +++ b/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java @@ -205,7 +205,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate the optional field `data` (array) for (int i = 0; i < jsonArraydata.size(); i++) { Transaction.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); - }; + } } } diff --git a/src/main/java/com/adyen/model/transfers/Transfer.java b/src/main/java/com/adyen/model/transfers/Transfer.java index 6d7cc3998..c3c9ccc3d 100644 --- a/src/main/java/com/adyen/model/transfers/Transfer.java +++ b/src/main/java/com/adyen/model/transfers/Transfer.java @@ -16,6 +16,8 @@ import java.util.Arrays; import com.adyen.model.transfers.Amount; import com.adyen.model.transfers.CounterpartyV3; +import com.adyen.model.transfers.PaymentInstrument; +import com.adyen.model.transfers.ResourceReference; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -50,10 +52,18 @@ */ public class Transfer { + public static final String SERIALIZED_NAME_ACCOUNT_HOLDER = "accountHolder"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_HOLDER) + private ResourceReference accountHolder; + public static final String SERIALIZED_NAME_AMOUNT = "amount"; @SerializedName(SERIALIZED_NAME_AMOUNT) private Amount amount; + public static final String SERIALIZED_NAME_BALANCE_ACCOUNT = "balanceAccount"; + @SerializedName(SERIALIZED_NAME_BALANCE_ACCOUNT) + private ResourceReference balanceAccount; + public static final String SERIALIZED_NAME_BALANCE_ACCOUNT_ID = "balanceAccountId"; @SerializedName(SERIALIZED_NAME_BALANCE_ACCOUNT_ID) private String balanceAccountId; @@ -176,6 +186,10 @@ public DirectionEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_ID) private String id; + public static final String SERIALIZED_NAME_PAYMENT_INSTRUMENT = "paymentInstrument"; + @SerializedName(SERIALIZED_NAME_PAYMENT_INSTRUMENT) + private PaymentInstrument paymentInstrument; + public static final String SERIALIZED_NAME_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; @SerializedName(SERIALIZED_NAME_PAYMENT_INSTRUMENT_ID) private String paymentInstrumentId; @@ -494,6 +508,28 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { public Transfer() { } + public Transfer accountHolder(ResourceReference accountHolder) { + + this.accountHolder = accountHolder; + return this; + } + + /** + * Get accountHolder + * @return accountHolder + **/ + @ApiModelProperty(value = "") + + public ResourceReference getAccountHolder() { + return accountHolder; + } + + + public void setAccountHolder(ResourceReference accountHolder) { + this.accountHolder = accountHolder; + } + + public Transfer amount(Amount amount) { this.amount = amount; @@ -516,6 +552,28 @@ public void setAmount(Amount amount) { } + public Transfer balanceAccount(ResourceReference balanceAccount) { + + this.balanceAccount = balanceAccount; + return this; + } + + /** + * Get balanceAccount + * @return balanceAccount + **/ + @ApiModelProperty(value = "") + + public ResourceReference getBalanceAccount() { + return balanceAccount; + } + + + public void setBalanceAccount(ResourceReference balanceAccount) { + this.balanceAccount = balanceAccount; + } + + public Transfer balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; @@ -525,7 +583,9 @@ public Transfer balanceAccountId(String balanceAccountId) { /** * The unique identifier of the source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). * @return balanceAccountId + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The unique identifier of the source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id).") public String getBalanceAccountId() { @@ -648,6 +708,28 @@ public void setId(String id) { } + public Transfer paymentInstrument(PaymentInstrument paymentInstrument) { + + this.paymentInstrument = paymentInstrument; + return this; + } + + /** + * Get paymentInstrument + * @return paymentInstrument + **/ + @ApiModelProperty(value = "") + + public PaymentInstrument getPaymentInstrument() { + return paymentInstrument; + } + + + public void setPaymentInstrument(PaymentInstrument paymentInstrument) { + this.paymentInstrument = paymentInstrument; + } + + public Transfer paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; @@ -655,10 +737,12 @@ public Transfer paymentInstrumentId(String paymentInstrumentId) { } /** - * The unique identifier of the source [payment instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/paymentInstruments__resParam_id). + * The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) used in the transfer. * @return paymentInstrumentId + * @deprecated **/ - @ApiModelProperty(value = "The unique identifier of the source [payment instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/paymentInstruments__resParam_id).") + @Deprecated + @ApiModelProperty(value = "The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) used in the transfer.") public String getPaymentInstrumentId() { return paymentInstrumentId; @@ -790,13 +874,16 @@ public boolean equals(Object o) { return false; } Transfer transfer = (Transfer) o; - return Objects.equals(this.amount, transfer.amount) && + return Objects.equals(this.accountHolder, transfer.accountHolder) && + Objects.equals(this.amount, transfer.amount) && + Objects.equals(this.balanceAccount, transfer.balanceAccount) && Objects.equals(this.balanceAccountId, transfer.balanceAccountId) && Objects.equals(this.category, transfer.category) && Objects.equals(this.counterparty, transfer.counterparty) && Objects.equals(this.description, transfer.description) && Objects.equals(this.direction, transfer.direction) && Objects.equals(this.id, transfer.id) && + Objects.equals(this.paymentInstrument, transfer.paymentInstrument) && Objects.equals(this.paymentInstrumentId, transfer.paymentInstrumentId) && Objects.equals(this.priority, transfer.priority) && Objects.equals(this.reason, transfer.reason) && @@ -807,20 +894,23 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(amount, balanceAccountId, category, counterparty, description, direction, id, paymentInstrumentId, priority, reason, reference, referenceForBeneficiary, status); + return Objects.hash(accountHolder, amount, balanceAccount, balanceAccountId, category, counterparty, description, direction, id, paymentInstrument, paymentInstrumentId, priority, reason, reference, referenceForBeneficiary, status); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Transfer {\n"); + sb.append(" accountHolder: ").append(toIndentedString(accountHolder)).append("\n"); sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" balanceAccount: ").append(toIndentedString(balanceAccount)).append("\n"); sb.append(" balanceAccountId: ").append(toIndentedString(balanceAccountId)).append("\n"); sb.append(" category: ").append(toIndentedString(category)).append("\n"); sb.append(" counterparty: ").append(toIndentedString(counterparty)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" direction: ").append(toIndentedString(direction)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" paymentInstrument: ").append(toIndentedString(paymentInstrument)).append("\n"); sb.append(" paymentInstrumentId: ").append(toIndentedString(paymentInstrumentId)).append("\n"); sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); @@ -849,13 +939,16 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("accountHolder"); openapiFields.add("amount"); + openapiFields.add("balanceAccount"); openapiFields.add("balanceAccountId"); openapiFields.add("category"); openapiFields.add("counterparty"); openapiFields.add("description"); openapiFields.add("direction"); openapiFields.add("id"); + openapiFields.add("paymentInstrument"); openapiFields.add("paymentInstrumentId"); openapiFields.add("priority"); openapiFields.add("reason"); @@ -900,10 +993,18 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); } } + // validate the optional field `accountHolder` + if (jsonObj.getAsJsonObject("accountHolder") != null) { + ResourceReference.validateJsonObject(jsonObj.getAsJsonObject("accountHolder")); + } // validate the optional field `amount` if (jsonObj.getAsJsonObject("amount") != null) { Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); } + // validate the optional field `balanceAccount` + if (jsonObj.getAsJsonObject("balanceAccount") != null) { + ResourceReference.validateJsonObject(jsonObj.getAsJsonObject("balanceAccount")); + } // validate the optional field balanceAccountId if (jsonObj.get("balanceAccountId") != null && !jsonObj.get("balanceAccountId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); @@ -934,6 +1035,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } + // validate the optional field `paymentInstrument` + if (jsonObj.getAsJsonObject("paymentInstrument") != null) { + PaymentInstrument.validateJsonObject(jsonObj.getAsJsonObject("paymentInstrument")); + } // validate the optional field paymentInstrumentId if (jsonObj.get("paymentInstrumentId") != null && !jsonObj.get("paymentInstrumentId").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `paymentInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentInstrumentId").toString())); diff --git a/src/main/java/com/adyen/model/transfers/TransferInfo.java b/src/main/java/com/adyen/model/transfers/TransferInfo.java index 2ee2667d9..a3d2cf825 100644 --- a/src/main/java/com/adyen/model/transfers/TransferInfo.java +++ b/src/main/java/com/adyen/model/transfers/TransferInfo.java @@ -16,6 +16,7 @@ import java.util.Arrays; import com.adyen.model.transfers.Amount; import com.adyen.model.transfers.CounterpartyInfoV3; +import com.adyen.model.transfers.UltimatePartyIdentification; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -198,6 +199,10 @@ public PriorityEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_REFERENCE_FOR_BENEFICIARY) private String referenceForBeneficiary; + public static final String SERIALIZED_NAME_ULTIMATE_PARTY = "ultimateParty"; + @SerializedName(SERIALIZED_NAME_ULTIMATE_PARTY) + private UltimatePartyIdentification ultimateParty; + public TransferInfo() { } @@ -421,6 +426,28 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { } + public TransferInfo ultimateParty(UltimatePartyIdentification ultimateParty) { + + this.ultimateParty = ultimateParty; + return this; + } + + /** + * Get ultimateParty + * @return ultimateParty + **/ + @ApiModelProperty(value = "") + + public UltimatePartyIdentification getUltimateParty() { + return ultimateParty; + } + + + public void setUltimateParty(UltimatePartyIdentification ultimateParty) { + this.ultimateParty = ultimateParty; + } + + @Override public boolean equals(Object o) { @@ -440,12 +467,13 @@ public boolean equals(Object o) { Objects.equals(this.paymentInstrumentId, transferInfo.paymentInstrumentId) && Objects.equals(this.priority, transferInfo.priority) && Objects.equals(this.reference, transferInfo.reference) && - Objects.equals(this.referenceForBeneficiary, transferInfo.referenceForBeneficiary); + Objects.equals(this.referenceForBeneficiary, transferInfo.referenceForBeneficiary) && + Objects.equals(this.ultimateParty, transferInfo.ultimateParty); } @Override public int hashCode() { - return Objects.hash(amount, balanceAccountId, category, counterparty, description, id, paymentInstrumentId, priority, reference, referenceForBeneficiary); + return Objects.hash(amount, balanceAccountId, category, counterparty, description, id, paymentInstrumentId, priority, reference, referenceForBeneficiary, ultimateParty); } @Override @@ -462,6 +490,7 @@ public String toString() { sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" referenceForBeneficiary: ").append(toIndentedString(referenceForBeneficiary)).append("\n"); + sb.append(" ultimateParty: ").append(toIndentedString(ultimateParty)).append("\n"); sb.append("}"); return sb.toString(); } @@ -494,6 +523,7 @@ private String toIndentedString(Object o) { openapiFields.add("priority"); openapiFields.add("reference"); openapiFields.add("referenceForBeneficiary"); + openapiFields.add("ultimateParty"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -577,6 +607,10 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj.get("referenceForBeneficiary") != null && !jsonObj.get("referenceForBeneficiary").isJsonPrimitive()) { throw new IllegalArgumentException(String.format("Expected the field `referenceForBeneficiary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceForBeneficiary").toString())); } + // validate the optional field `ultimateParty` + if (jsonObj.getAsJsonObject("ultimateParty") != null) { + UltimatePartyIdentification.validateJsonObject(jsonObj.getAsJsonObject("ultimateParty")); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java b/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java new file mode 100644 index 000000000..bce5fe94e --- /dev/null +++ b/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java @@ -0,0 +1,464 @@ +/* + * Transfers API + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.transfers; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.transfers.Address2; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.LocalDate; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.transfers.JSON; + +/** + * UltimatePartyIdentification + */ + +public class UltimatePartyIdentification { + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private Address2 address; + + public static final String SERIALIZED_NAME_DATE_OF_BIRTH = "dateOfBirth"; + @SerializedName(SERIALIZED_NAME_DATE_OF_BIRTH) + private LocalDate dateOfBirth; + + public static final String SERIALIZED_NAME_FIRST_NAME = "firstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + private String firstName; + + public static final String SERIALIZED_NAME_FULL_NAME = "fullName"; + @SerializedName(SERIALIZED_NAME_FULL_NAME) + private String fullName; + + public static final String SERIALIZED_NAME_LAST_NAME = "lastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + private String lastName; + + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; + + /** + * The type of entity that owns the bank account. Possible values: **individual**, **organization**, or **unknown**. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + INDIVIDUAL("individual"), + + ORGANIZATION("organization"), + + UNKNOWN("unknown"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type = TypeEnum.UNKNOWN; + + public UltimatePartyIdentification() { + } + + public UltimatePartyIdentification address(Address2 address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @ApiModelProperty(value = "") + + public Address2 getAddress() { + return address; + } + + + public void setAddress(Address2 address) { + this.address = address; + } + + + public UltimatePartyIdentification dateOfBirth(LocalDate dateOfBirth) { + + this.dateOfBirth = dateOfBirth; + return this; + } + + /** + * The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**. Allowed only when `type` is **individual**. + * @return dateOfBirth + **/ + @ApiModelProperty(value = "The date of birth of the individual in [ISO-8601](https://www.w3.org/TR/NOTE-datetime) format. For example, **YYYY-MM-DD**. Allowed only when `type` is **individual**.") + + public LocalDate getDateOfBirth() { + return dateOfBirth; + } + + + public void setDateOfBirth(LocalDate dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + + public UltimatePartyIdentification firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * First name of the individual. Allowed only when `type` is **individual**. + * @return firstName + **/ + @ApiModelProperty(value = "First name of the individual. Allowed only when `type` is **individual**.") + + public String getFirstName() { + return firstName; + } + + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public UltimatePartyIdentification fullName(String fullName) { + + this.fullName = fullName; + return this; + } + + /** + * The name of the entity. + * @return fullName + **/ + @ApiModelProperty(required = true, value = "The name of the entity.") + + public String getFullName() { + return fullName; + } + + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + public UltimatePartyIdentification lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Last name of the individual. Allowed only when `type` is **individual**. + * @return lastName + **/ + @ApiModelProperty(value = "Last name of the individual. Allowed only when `type` is **individual**.") + + public String getLastName() { + return lastName; + } + + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public UltimatePartyIdentification reference(String reference) { + + this.reference = reference; + return this; + } + + /** + * Your unique reference of the party. This should be consistent for all transfers initiated to/from the same party/counterparty. e.g Your client's unique wallet or payee ID + * @return reference + **/ + @ApiModelProperty(value = "Your unique reference of the party. This should be consistent for all transfers initiated to/from the same party/counterparty. e.g Your client's unique wallet or payee ID") + + public String getReference() { + return reference; + } + + + public void setReference(String reference) { + this.reference = reference; + } + + + public UltimatePartyIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of entity that owns the bank account. Possible values: **individual**, **organization**, or **unknown**. + * @return type + **/ + @ApiModelProperty(value = "The type of entity that owns the bank account. Possible values: **individual**, **organization**, or **unknown**.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UltimatePartyIdentification ultimatePartyIdentification = (UltimatePartyIdentification) o; + return Objects.equals(this.address, ultimatePartyIdentification.address) && + Objects.equals(this.dateOfBirth, ultimatePartyIdentification.dateOfBirth) && + Objects.equals(this.firstName, ultimatePartyIdentification.firstName) && + Objects.equals(this.fullName, ultimatePartyIdentification.fullName) && + Objects.equals(this.lastName, ultimatePartyIdentification.lastName) && + Objects.equals(this.reference, ultimatePartyIdentification.reference) && + Objects.equals(this.type, ultimatePartyIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(address, dateOfBirth, firstName, fullName, lastName, reference, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UltimatePartyIdentification {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" dateOfBirth: ").append(toIndentedString(dateOfBirth)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("address"); + openapiFields.add("dateOfBirth"); + openapiFields.add("firstName"); + openapiFields.add("fullName"); + openapiFields.add("lastName"); + openapiFields.add("reference"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("fullName"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to UltimatePartyIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (UltimatePartyIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in UltimatePartyIdentification is not found in the empty JSON string", UltimatePartyIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!UltimatePartyIdentification.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UltimatePartyIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UltimatePartyIdentification.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `address` + if (jsonObj.getAsJsonObject("address") != null) { + Address2.validateJsonObject(jsonObj.getAsJsonObject("address")); + } + // validate the optional field firstName + if (jsonObj.get("firstName") != null && !jsonObj.get("firstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `firstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstName").toString())); + } + // validate the optional field fullName + if (jsonObj.get("fullName") != null && !jsonObj.get("fullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullName").toString())); + } + // validate the optional field lastName + if (jsonObj.get("lastName") != null && !jsonObj.get("lastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UltimatePartyIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UltimatePartyIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UltimatePartyIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, UltimatePartyIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UltimatePartyIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UltimatePartyIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of UltimatePartyIdentification + * @throws IOException if the JSON string is invalid with respect to UltimatePartyIdentification + */ + public static UltimatePartyIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UltimatePartyIdentification.class); + } + + /** + * Convert an instance of UltimatePartyIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/test/java/com/adyen/MarketPayTest.java b/src/test/java/com/adyen/MarketPayTest.java index 62b197b42..e3ca5c9e9 100644 --- a/src/test/java/com/adyen/MarketPayTest.java +++ b/src/test/java/com/adyen/MarketPayTest.java @@ -129,7 +129,7 @@ public void TestCreateSplitPayment() throws Exception { assertEquals(11, paymentResult.getFraudResult().getResults().size()); - FraudCheckResult fraudCheckResult = paymentResult.getFraudResult().getResults().get(0); + FraudCheckResult fraudCheckResult = paymentResult.getFraudResult().getResults().get(0).getFraudCheckResult(); assertEquals("CardChunkUsage", fraudCheckResult.getName()); assertEquals(8, fraudCheckResult.getAccountScore().intValue()); assertEquals(2, fraudCheckResult.getCheckId().intValue()); diff --git a/src/test/java/com/adyen/PaymentTest.java b/src/test/java/com/adyen/PaymentTest.java index 15b2ae1f6..566ce2f67 100644 --- a/src/test/java/com/adyen/PaymentTest.java +++ b/src/test/java/com/adyen/PaymentTest.java @@ -93,7 +93,7 @@ public void TestAuthoriseSuccessMocked() throws Exception { assertEquals(11, paymentResult.getFraudResult().getResults().size()); - FraudCheckResult fraudCheckResult = paymentResult.getFraudResult().getResults().get(0); + FraudCheckResult fraudCheckResult = paymentResult.getFraudResult().getResults().get(0).getFraudCheckResult(); assertEquals("CardChunkUsage", fraudCheckResult.getName()); assertEquals(8, fraudCheckResult.getAccountScore().intValue()); assertEquals(2, fraudCheckResult.getCheckId().intValue()); diff --git a/src/test/resources/mocks/authorise-error-cvc-declined.json b/src/test/resources/mocks/authorise-error-cvc-declined.json index cce7eda35..14a51fd92 100644 --- a/src/test/resources/mocks/authorise-error-cvc-declined.json +++ b/src/test/resources/mocks/authorise-error-cvc-declined.json @@ -6,58 +6,73 @@ }, "fraudResult": { "accountScore": 50, - "results": [ - { - "accountScore": 0, + "results": [{ + "FraudCheckResult": { + "accountScore": 8, "checkId": 2, "name": "CardChunkUsage" - }, - { - "accountScore": 0, + } + }, { + "FraudCheckResult": { + "accountScore": 5, "checkId": 3, "name": "PaymentDetailUsage" - }, - { - "accountScore": 0, + } + }, { + "FraudCheckResult": { + "accountScore": 12, "checkId": 4, "name": "HolderNameUsage" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 1, "name": "PaymentDetailRefCheck" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 13, "name": "IssuerRefCheck" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 15, "name": "IssuingCountryReferral" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 27, "name": "PmOwnerRefCheck" - }, - { - "accountScore": 50, + } + }, { + "FraudCheckResult": { + "accountScore": 0, "checkId": 41, "name": "PaymentDetailNonFraudRefCheck" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 10, "name": "HolderNameContainsNumber" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 11, "name": "HolderNameIsOneWord" } - ] + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 25, + "name": "CVCAuthResultCheck" + } + }] }, "pspReference": "7924836078655376", "refusalReason": "CVC Declined", diff --git a/src/test/resources/mocks/authorise-error-expired.json b/src/test/resources/mocks/authorise-error-expired.json index 18225d951..98d63d200 100644 --- a/src/test/resources/mocks/authorise-error-expired.json +++ b/src/test/resources/mocks/authorise-error-expired.json @@ -10,58 +10,73 @@ }, "fraudResult": { "accountScore": 51, - "results": [ - { - "accountScore": 0, + "results": [{ + "FraudCheckResult": { + "accountScore": 8, "checkId": 2, "name": "CardChunkUsage" - }, - { - "accountScore": 0, + } + }, { + "FraudCheckResult": { + "accountScore": 5, "checkId": 3, "name": "PaymentDetailUsage" - }, - { - "accountScore": 0, + } + }, { + "FraudCheckResult": { + "accountScore": 12, "checkId": 4, "name": "HolderNameUsage" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 1, "name": "PaymentDetailRefCheck" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 13, "name": "IssuerRefCheck" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 15, "name": "IssuingCountryReferral" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 27, "name": "PmOwnerRefCheck" - }, - { - "accountScore": 50, + } + }, { + "FraudCheckResult": { + "accountScore": 0, "checkId": 41, "name": "PaymentDetailNonFraudRefCheck" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 10, "name": "HolderNameContainsNumber" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 11, "name": "HolderNameIsOneWord" } - ] + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 25, + "name": "CVCAuthResultCheck" + } + }] }, "pspReference": "7924836277951659", "refusalReason": "Refused", diff --git a/src/test/resources/mocks/authorise-success-3d.json b/src/test/resources/mocks/authorise-success-3d.json index 42c4afe73..0f3a7382a 100644 --- a/src/test/resources/mocks/authorise-success-3d.json +++ b/src/test/resources/mocks/authorise-success-3d.json @@ -6,58 +6,73 @@ }, "fraudResult": { "accountScore": 0, - "results": [ - { - "accountScore": 0, + "results": [{ + "FraudCheckResult": { + "accountScore": 8, "checkId": 2, "name": "CardChunkUsage" - }, - { - "accountScore": 0, + } + }, { + "FraudCheckResult": { + "accountScore": 5, "checkId": 3, "name": "PaymentDetailUsage" - }, - { - "accountScore": 0, + } + }, { + "FraudCheckResult": { + "accountScore": 12, "checkId": 4, "name": "HolderNameUsage" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 1, "name": "PaymentDetailRefCheck" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 13, "name": "IssuerRefCheck" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 15, "name": "IssuingCountryReferral" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 27, "name": "PmOwnerRefCheck" - }, - { - "accountScore": 50, + } + }, { + "FraudCheckResult": { + "accountScore": 0, "checkId": 41, "name": "PaymentDetailNonFraudRefCheck" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 10, "name": "HolderNameContainsNumber" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 11, "name": "HolderNameIsOneWord" } - ] + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 25, + "name": "CVCAuthResultCheck" + } + }] }, "pspReference": "7924836133944997", "resultCode": "RedirectShopper", diff --git a/src/test/resources/mocks/authorise-success-cse.json b/src/test/resources/mocks/authorise-success-cse.json index 0fd45365f..90d69f9e2 100644 --- a/src/test/resources/mocks/authorise-success-cse.json +++ b/src/test/resources/mocks/authorise-success-cse.json @@ -13,58 +13,73 @@ }, "fraudResult": { "accountScore": 51, - "results": [ - { - "accountScore": 0, + "results": [{ + "FraudCheckResult": { + "accountScore": 8, "checkId": 2, "name": "CardChunkUsage" - }, - { - "accountScore": 0, + } + }, { + "FraudCheckResult": { + "accountScore": 5, "checkId": 3, "name": "PaymentDetailUsage" - }, - { - "accountScore": 0, + } + }, { + "FraudCheckResult": { + "accountScore": 12, "checkId": 4, "name": "HolderNameUsage" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 1, "name": "PaymentDetailRefCheck" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 13, "name": "IssuerRefCheck" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 15, "name": "IssuingCountryReferral" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 27, "name": "PmOwnerRefCheck" - }, - { - "accountScore": 50, + } + }, { + "FraudCheckResult": { + "accountScore": 0, "checkId": 41, "name": "PaymentDetailNonFraudRefCheck" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 10, "name": "HolderNameContainsNumber" - }, - { + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 11, "name": "HolderNameIsOneWord" } - ] + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 25, + "name": "CVCAuthResultCheck" + } + }] }, "pspReference": "8624836275772397", "resultCode": "Authorised", diff --git a/src/test/resources/mocks/authorise-success.json b/src/test/resources/mocks/authorise-success.json index 5662c6d0a..cfd8b0f42 100644 --- a/src/test/resources/mocks/authorise-success.json +++ b/src/test/resources/mocks/authorise-success.json @@ -22,49 +22,71 @@ "fraudResult": { "accountScore": 25, "results": [{ + "FraudCheckResult": { "accountScore": 8, "checkId": 2, "name": "CardChunkUsage" + } }, { + "FraudCheckResult": { "accountScore": 5, "checkId": 3, "name": "PaymentDetailUsage" + } }, { + "FraudCheckResult": { "accountScore": 12, "checkId": 4, "name": "HolderNameUsage" + } }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 1, "name": "PaymentDetailRefCheck" + } }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 13, "name": "IssuerRefCheck" + } }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 15, "name": "IssuingCountryReferral" + } }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 27, "name": "PmOwnerRefCheck" + } }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 41, "name": "PaymentDetailNonFraudRefCheck" + } }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 10, "name": "HolderNameContainsNumber" + } }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 11, "name": "HolderNameIsOneWord" + } }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 25, "name": "CVCAuthResultCheck" + } }] }, "pspReference": "7924835492819808", diff --git a/src/test/resources/mocks/authorise3d-success.json b/src/test/resources/mocks/authorise3d-success.json index e6d11e6bf..6644aad08 100644 --- a/src/test/resources/mocks/authorise3d-success.json +++ b/src/test/resources/mocks/authorise3d-success.json @@ -7,18 +7,73 @@ }, "fraudResult": { "accountScore": 12, - "results": [ - { + "results": [{ + "FraudCheckResult": { + "accountScore": 8, + "checkId": 2, + "name": "CardChunkUsage" + } + }, { + "FraudCheckResult": { + "accountScore": 5, + "checkId": 3, + "name": "PaymentDetailUsage" + } + }, { + "FraudCheckResult": { "accountScore": 12, - "checkId": -1, - "name": "Pre-Auth-Risk-Total" - }, - { + "checkId": 4, + "name": "HolderNameUsage" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 1, + "name": "PaymentDetailRefCheck" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 13, + "name": "IssuerRefCheck" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 15, + "name": "IssuingCountryReferral" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 27, + "name": "PmOwnerRefCheck" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 41, + "name": "PaymentDetailNonFraudRefCheck" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 10, + "name": "HolderNameContainsNumber" + } + }, { + "FraudCheckResult": { + "accountScore": 0, + "checkId": 11, + "name": "HolderNameIsOneWord" + } + }, { + "FraudCheckResult": { "accountScore": 0, "checkId": 25, "name": "CVCAuthResultCheck" } - ] + }] }, "pspReference": "8524836146572696", "resultCode": "Authorised", From 891423a965f3c6a33782b32c1584f7b0fd04a0c9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 5 May 2023 11:30:37 +0200 Subject: [PATCH 23/32] chore(deps): update dependency org.mockito:mockito-core to v5.3.1 (#1007) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5844a447b..85c59d220 100644 --- a/pom.xml +++ b/pom.xml @@ -208,7 +208,7 @@ org.mockito mockito-core - 5.3.0 + 5.3.1 test From 37d89609e12601dc5ad064c08d0f1ab6e29328e8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 10:59:16 +0200 Subject: [PATCH 24/32] chore(deps): update dependency org.apache.maven.plugins:maven-gpg-plugin to v3.1.0 (#1017) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 85c59d220..b6f9a7e12 100644 --- a/pom.xml +++ b/pom.xml @@ -117,7 +117,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.1.0 sign-artifacts From 91079962d7effdcdc9e4af980702e712d9dfb302 Mon Sep 17 00:00:00 2001 From: Beppe Catanese <1771700+gcatanese@users.noreply.github.com> Date: Mon, 8 May 2023 11:18:42 +0200 Subject: [PATCH 25/32] Deprecate build and setter methods (#1015) --- templates/libraries/okhttp-gson/pojo.mustache | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/templates/libraries/okhttp-gson/pojo.mustache b/templates/libraries/okhttp-gson/pojo.mustache index 102059098..a940a4af6 100644 --- a/templates/libraries/okhttp-gson/pojo.mustache +++ b/templates/libraries/okhttp-gson/pojo.mustache @@ -82,6 +82,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isXmlAttribute}} {{/withXml}} {{#gson}} + {{#deprecated}} + @Deprecated + {{/deprecated}} @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) {{/gson}} {{#vendorExtensions.x-field-extra-annotation}} @@ -124,6 +127,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{#vars}} {{^isReadOnly}} + {{#deprecated}} + @Deprecated + {{/deprecated}} public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});{{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = {{name}};{{/vendorExtensions.x-is-jackson-optional-nullable}} @@ -243,7 +249,8 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{^isReadOnly}} {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} -{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { +{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}}{{#deprecated}} @Deprecated +{{/deprecated}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-is-jackson-optional-nullable}} this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); {{/vendorExtensions.x-is-jackson-optional-nullable}} From 4d966d217c3fd58c5c8062af47428ab3b750e29b Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Mon, 8 May 2023 11:44:07 +0200 Subject: [PATCH 26/32] add balancecontrol and regenerate dataprotection endpoints (#1010) --- .../balancecontrol/AbstractOpenApiSchema.java | 145 +++++ .../adyen/model/balancecontrol/Amount.java | 247 ++++++++ .../BalanceTransferRequest.java | 444 +++++++++++++ .../BalanceTransferResponse.java | 597 ++++++++++++++++++ .../com/adyen/model/balancecontrol/JSON.java | 402 ++++++++++++ .../dataprotection/AbstractOpenApiSchema.java | 145 +++++ .../com/adyen/model/dataprotection/JSON.java | 402 ++++++++++++ .../model/dataprotection/ServiceError.java | 337 ++++++++++ .../SubjectErasureByPspReferenceRequest.java | 271 ++++++++ .../dataprotection/SubjectErasureRequest.java | 137 ---- .../SubjectErasureResponse.java | 321 +++++++--- .../com/adyen/service/BalanceControlApi.java | 62 ++ .../com/adyen/service/DataProtection.java | 62 -- .../com/adyen/service/DataProtectionApi.java | 63 ++ .../java/com/adyen/BalanceControlTest.java | 37 ++ .../com/adyen/DataProtectionServiceTest.java | 27 +- .../mocks/smallendpoints/balance-control.json | 14 + 17 files changed, 3405 insertions(+), 308 deletions(-) create mode 100644 src/main/java/com/adyen/model/balancecontrol/AbstractOpenApiSchema.java create mode 100644 src/main/java/com/adyen/model/balancecontrol/Amount.java create mode 100644 src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java create mode 100644 src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java create mode 100644 src/main/java/com/adyen/model/balancecontrol/JSON.java create mode 100644 src/main/java/com/adyen/model/dataprotection/AbstractOpenApiSchema.java create mode 100644 src/main/java/com/adyen/model/dataprotection/JSON.java create mode 100644 src/main/java/com/adyen/model/dataprotection/ServiceError.java create mode 100644 src/main/java/com/adyen/model/dataprotection/SubjectErasureByPspReferenceRequest.java delete mode 100644 src/main/java/com/adyen/model/dataprotection/SubjectErasureRequest.java create mode 100644 src/main/java/com/adyen/service/BalanceControlApi.java delete mode 100644 src/main/java/com/adyen/service/DataProtection.java create mode 100644 src/main/java/com/adyen/service/DataProtectionApi.java create mode 100644 src/test/java/com/adyen/BalanceControlTest.java create mode 100644 src/test/resources/mocks/smallendpoints/balance-control.json diff --git a/src/main/java/com/adyen/model/balancecontrol/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/balancecontrol/AbstractOpenApiSchema.java new file mode 100644 index 000000000..5e3d95ddd --- /dev/null +++ b/src/main/java/com/adyen/model/balancecontrol/AbstractOpenApiSchema.java @@ -0,0 +1,145 @@ +/* + * Adyen Balance Control API + * The Balance Control API lets you transfer funds between merchant accounts that belong to the same legal entity and are under the same company account. ## Authentication To connect to the Balance Control API, you must authenticate your requests with an [API key or basic auth username and password](https://docs.adyen.com/development-resources/api-authentication). To learn how you can generate these, see [API credentials](https://docs.adyen.com/development-resources/api-credentials).Here is an example of authenticating a request with an API key: ``` curl -H \"X-API-Key: Your_API_key\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate API credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning The Balance Control API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BalanceControl/v1/balanceTransfer ``` + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balancecontrol; + +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import jakarta.ws.rs.core.GenericType; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/src/main/java/com/adyen/model/balancecontrol/Amount.java b/src/main/java/com/adyen/model/balancecontrol/Amount.java new file mode 100644 index 000000000..db7b2578f --- /dev/null +++ b/src/main/java/com/adyen/model/balancecontrol/Amount.java @@ -0,0 +1,247 @@ +/* + * Adyen Balance Control API + * The Balance Control API lets you transfer funds between merchant accounts that belong to the same legal entity and are under the same company account. ## Authentication To connect to the Balance Control API, you must authenticate your requests with an [API key or basic auth username and password](https://docs.adyen.com/development-resources/api-authentication). To learn how you can generate these, see [API credentials](https://docs.adyen.com/development-resources/api-credentials).Here is an example of authenticating a request with an API key: ``` curl -H \"X-API-Key: Your_API_key\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate API credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning The Balance Control API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BalanceControl/v1/balanceTransfer ``` + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balancecontrol; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balancecontrol.JSON; + +/** + * Amount + */ + +public class Amount { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private Long value; + + public Amount() { + } + + public Amount currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @return currency + **/ + @ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).") + + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + + public Amount value(Long value) { + + this.value = value; + return this; + } + + /** + * The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * @return value + **/ + @ApiModelProperty(required = true, value = "The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).") + + public Long getValue() { + return value; + } + + + public void setValue(Long value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Amount amount = (Amount) o; + return Objects.equals(this.currency, amount.currency) && + Objects.equals(this.value, amount.value); + } + + @Override + public int hashCode() { + return Objects.hash(currency, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Amount {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("currency"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("currency"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Amount + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Amount.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Amount is not found in the empty JSON string", Amount.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Amount.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Amount` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Amount.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field currency + if (jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Amount.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Amount' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Amount.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Amount value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Amount read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Amount given an JSON string + * + * @param jsonString JSON string + * @return An instance of Amount + * @throws IOException if the JSON string is invalid with respect to Amount + */ + public static Amount fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Amount.class); + } + + /** + * Convert an instance of Amount to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java new file mode 100644 index 000000000..a5bab2f59 --- /dev/null +++ b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java @@ -0,0 +1,444 @@ +/* + * Adyen Balance Control API + * The Balance Control API lets you transfer funds between merchant accounts that belong to the same legal entity and are under the same company account. ## Authentication To connect to the Balance Control API, you must authenticate your requests with an [API key or basic auth username and password](https://docs.adyen.com/development-resources/api-authentication). To learn how you can generate these, see [API credentials](https://docs.adyen.com/development-resources/api-credentials).Here is an example of authenticating a request with an API key: ``` curl -H \"X-API-Key: Your_API_key\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate API credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning The Balance Control API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BalanceControl/v1/balanceTransfer ``` + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balancecontrol; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balancecontrol.Amount; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balancecontrol.JSON; + +/** + * BalanceTransferRequest + */ + +public class BalanceTransferRequest { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_FROM_MERCHANT = "fromMerchant"; + @SerializedName(SERIALIZED_NAME_FROM_MERCHANT) + private String fromMerchant; + + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; + + public static final String SERIALIZED_NAME_TO_MERCHANT = "toMerchant"; + @SerializedName(SERIALIZED_NAME_TO_MERCHANT) + private String toMerchant; + + /** + * The type of balance transfer. Possible values: **tax**, **fee**, **terminalSale**, **credit**, **debit**, and **adjustment**. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + TAX("tax"), + + FEE("fee"), + + TERMINALSALE("terminalSale"), + + CREDIT("credit"), + + DEBIT("debit"), + + ADJUSTMENT("adjustment"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public BalanceTransferRequest() { + } + + public BalanceTransferRequest amount(Amount amount) { + + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + **/ + @ApiModelProperty(required = true, value = "") + + public Amount getAmount() { + return amount; + } + + + public void setAmount(Amount amount) { + this.amount = amount; + } + + + public BalanceTransferRequest description(String description) { + + this.description = description; + return this; + } + + /** + * A human-readable description for the transfer. You can use alphanumeric characters and hyphens. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. + * @return description + **/ + @ApiModelProperty(value = "A human-readable description for the transfer. You can use alphanumeric characters and hyphens. We recommend sending a maximum of 140 characters, otherwise the description may be truncated.") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public BalanceTransferRequest fromMerchant(String fromMerchant) { + + this.fromMerchant = fromMerchant; + return this; + } + + /** + * The unique identifier of the source merchant account from which funds are deducted. + * @return fromMerchant + **/ + @ApiModelProperty(required = true, value = "The unique identifier of the source merchant account from which funds are deducted.") + + public String getFromMerchant() { + return fromMerchant; + } + + + public void setFromMerchant(String fromMerchant) { + this.fromMerchant = fromMerchant; + } + + + public BalanceTransferRequest reference(String reference) { + + this.reference = reference; + return this; + } + + /** + * A reference for the balance transfer. If you don't provide this in the request, Adyen generates a unique reference. Maximum length: 80 characters. + * @return reference + **/ + @ApiModelProperty(value = "A reference for the balance transfer. If you don't provide this in the request, Adyen generates a unique reference. Maximum length: 80 characters.") + + public String getReference() { + return reference; + } + + + public void setReference(String reference) { + this.reference = reference; + } + + + public BalanceTransferRequest toMerchant(String toMerchant) { + + this.toMerchant = toMerchant; + return this; + } + + /** + * The unique identifier of the destination merchant account from which funds are transferred. + * @return toMerchant + **/ + @ApiModelProperty(required = true, value = "The unique identifier of the destination merchant account from which funds are transferred.") + + public String getToMerchant() { + return toMerchant; + } + + + public void setToMerchant(String toMerchant) { + this.toMerchant = toMerchant; + } + + + public BalanceTransferRequest type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of balance transfer. Possible values: **tax**, **fee**, **terminalSale**, **credit**, **debit**, and **adjustment**. + * @return type + **/ + @ApiModelProperty(required = true, value = "The type of balance transfer. Possible values: **tax**, **fee**, **terminalSale**, **credit**, **debit**, and **adjustment**.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BalanceTransferRequest balanceTransferRequest = (BalanceTransferRequest) o; + return Objects.equals(this.amount, balanceTransferRequest.amount) && + Objects.equals(this.description, balanceTransferRequest.description) && + Objects.equals(this.fromMerchant, balanceTransferRequest.fromMerchant) && + Objects.equals(this.reference, balanceTransferRequest.reference) && + Objects.equals(this.toMerchant, balanceTransferRequest.toMerchant) && + Objects.equals(this.type, balanceTransferRequest.type); + } + + @Override + public int hashCode() { + return Objects.hash(amount, description, fromMerchant, reference, toMerchant, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BalanceTransferRequest {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" fromMerchant: ").append(toIndentedString(fromMerchant)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" toMerchant: ").append(toIndentedString(toMerchant)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("amount"); + openapiFields.add("description"); + openapiFields.add("fromMerchant"); + openapiFields.add("reference"); + openapiFields.add("toMerchant"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("amount"); + openapiRequiredFields.add("fromMerchant"); + openapiRequiredFields.add("toMerchant"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BalanceTransferRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BalanceTransferRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BalanceTransferRequest is not found in the empty JSON string", BalanceTransferRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BalanceTransferRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BalanceTransferRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BalanceTransferRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + // validate the optional field description + if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // validate the optional field fromMerchant + if (jsonObj.get("fromMerchant") != null && !jsonObj.get("fromMerchant").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fromMerchant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fromMerchant").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + // validate the optional field toMerchant + if (jsonObj.get("toMerchant") != null && !jsonObj.get("toMerchant").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `toMerchant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("toMerchant").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BalanceTransferRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BalanceTransferRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BalanceTransferRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BalanceTransferRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BalanceTransferRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BalanceTransferRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of BalanceTransferRequest + * @throws IOException if the JSON string is invalid with respect to BalanceTransferRequest + */ + public static BalanceTransferRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BalanceTransferRequest.class); + } + + /** + * Convert an instance of BalanceTransferRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java new file mode 100644 index 000000000..16e09421f --- /dev/null +++ b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java @@ -0,0 +1,597 @@ +/* + * Adyen Balance Control API + * The Balance Control API lets you transfer funds between merchant accounts that belong to the same legal entity and are under the same company account. ## Authentication To connect to the Balance Control API, you must authenticate your requests with an [API key or basic auth username and password](https://docs.adyen.com/development-resources/api-authentication). To learn how you can generate these, see [API credentials](https://docs.adyen.com/development-resources/api-credentials).Here is an example of authenticating a request with an API key: ``` curl -H \"X-API-Key: Your_API_key\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate API credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning The Balance Control API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BalanceControl/v1/balanceTransfer ``` + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balancecontrol; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.balancecontrol.Amount; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.balancecontrol.JSON; + +/** + * BalanceTransferResponse + */ + +public class BalanceTransferResponse { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_FROM_MERCHANT = "fromMerchant"; + @SerializedName(SERIALIZED_NAME_FROM_MERCHANT) + private String fromMerchant; + + public static final String SERIALIZED_NAME_PSP_REFERENCE = "pspReference"; + @SerializedName(SERIALIZED_NAME_PSP_REFERENCE) + private String pspReference; + + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; + + /** + * The status of the balance transfer. Possible values: **transferred**, **failed**, **error**, and **notEnoughBalance**. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ERROR("error"), + + FAILED("failed"), + + NOTENOUGHBALANCE("notEnoughBalance"), + + TRANSFERRED("transferred"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public static final String SERIALIZED_NAME_TO_MERCHANT = "toMerchant"; + @SerializedName(SERIALIZED_NAME_TO_MERCHANT) + private String toMerchant; + + /** + * The type of balance transfer. Possible values: **tax**, **fee**, **terminalSale**, **credit**, **debit**, and **adjustment**. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + TAX("tax"), + + FEE("fee"), + + TERMINALSALE("terminalSale"), + + CREDIT("credit"), + + DEBIT("debit"), + + ADJUSTMENT("adjustment"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private TypeEnum type; + + public BalanceTransferResponse() { + } + + public BalanceTransferResponse amount(Amount amount) { + + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + **/ + @ApiModelProperty(required = true, value = "") + + public Amount getAmount() { + return amount; + } + + + public void setAmount(Amount amount) { + this.amount = amount; + } + + + public BalanceTransferResponse createdAt(OffsetDateTime createdAt) { + + this.createdAt = createdAt; + return this; + } + + /** + * The date when the balance transfer was requested. + * @return createdAt + **/ + @ApiModelProperty(required = true, value = "The date when the balance transfer was requested.") + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public BalanceTransferResponse description(String description) { + + this.description = description; + return this; + } + + /** + * A human-readable description for the transfer. You can use alphanumeric characters and hyphens. We recommend sending a maximum of 140 characters, otherwise the description may be truncated. + * @return description + **/ + @ApiModelProperty(value = "A human-readable description for the transfer. You can use alphanumeric characters and hyphens. We recommend sending a maximum of 140 characters, otherwise the description may be truncated.") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public BalanceTransferResponse fromMerchant(String fromMerchant) { + + this.fromMerchant = fromMerchant; + return this; + } + + /** + * The unique identifier of the source merchant account from which funds are deducted. + * @return fromMerchant + **/ + @ApiModelProperty(required = true, value = "The unique identifier of the source merchant account from which funds are deducted.") + + public String getFromMerchant() { + return fromMerchant; + } + + + public void setFromMerchant(String fromMerchant) { + this.fromMerchant = fromMerchant; + } + + + public BalanceTransferResponse pspReference(String pspReference) { + + this.pspReference = pspReference; + return this; + } + + /** + * Adyen's 16-character string reference associated with the balance transfer. + * @return pspReference + **/ + @ApiModelProperty(required = true, value = "Adyen's 16-character string reference associated with the balance transfer.") + + public String getPspReference() { + return pspReference; + } + + + public void setPspReference(String pspReference) { + this.pspReference = pspReference; + } + + + public BalanceTransferResponse reference(String reference) { + + this.reference = reference; + return this; + } + + /** + * A reference for the balance transfer. If you don't provide this in the request, Adyen generates a unique reference. Maximum length: 80 characters. + * @return reference + **/ + @ApiModelProperty(value = "A reference for the balance transfer. If you don't provide this in the request, Adyen generates a unique reference. Maximum length: 80 characters.") + + public String getReference() { + return reference; + } + + + public void setReference(String reference) { + this.reference = reference; + } + + + public BalanceTransferResponse status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the balance transfer. Possible values: **transferred**, **failed**, **error**, and **notEnoughBalance**. + * @return status + **/ + @ApiModelProperty(required = true, value = "The status of the balance transfer. Possible values: **transferred**, **failed**, **error**, and **notEnoughBalance**.") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public BalanceTransferResponse toMerchant(String toMerchant) { + + this.toMerchant = toMerchant; + return this; + } + + /** + * The unique identifier of the destination merchant account from which funds are transferred. + * @return toMerchant + **/ + @ApiModelProperty(required = true, value = "The unique identifier of the destination merchant account from which funds are transferred.") + + public String getToMerchant() { + return toMerchant; + } + + + public void setToMerchant(String toMerchant) { + this.toMerchant = toMerchant; + } + + + public BalanceTransferResponse type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of balance transfer. Possible values: **tax**, **fee**, **terminalSale**, **credit**, **debit**, and **adjustment**. + * @return type + **/ + @ApiModelProperty(required = true, value = "The type of balance transfer. Possible values: **tax**, **fee**, **terminalSale**, **credit**, **debit**, and **adjustment**.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BalanceTransferResponse balanceTransferResponse = (BalanceTransferResponse) o; + return Objects.equals(this.amount, balanceTransferResponse.amount) && + Objects.equals(this.createdAt, balanceTransferResponse.createdAt) && + Objects.equals(this.description, balanceTransferResponse.description) && + Objects.equals(this.fromMerchant, balanceTransferResponse.fromMerchant) && + Objects.equals(this.pspReference, balanceTransferResponse.pspReference) && + Objects.equals(this.reference, balanceTransferResponse.reference) && + Objects.equals(this.status, balanceTransferResponse.status) && + Objects.equals(this.toMerchant, balanceTransferResponse.toMerchant) && + Objects.equals(this.type, balanceTransferResponse.type); + } + + @Override + public int hashCode() { + return Objects.hash(amount, createdAt, description, fromMerchant, pspReference, reference, status, toMerchant, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BalanceTransferResponse {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" fromMerchant: ").append(toIndentedString(fromMerchant)).append("\n"); + sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" toMerchant: ").append(toIndentedString(toMerchant)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("amount"); + openapiFields.add("createdAt"); + openapiFields.add("description"); + openapiFields.add("fromMerchant"); + openapiFields.add("pspReference"); + openapiFields.add("reference"); + openapiFields.add("status"); + openapiFields.add("toMerchant"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("amount"); + openapiRequiredFields.add("createdAt"); + openapiRequiredFields.add("fromMerchant"); + openapiRequiredFields.add("pspReference"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("toMerchant"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BalanceTransferResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BalanceTransferResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BalanceTransferResponse is not found in the empty JSON string", BalanceTransferResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BalanceTransferResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BalanceTransferResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BalanceTransferResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + // validate the optional field description + if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // validate the optional field fromMerchant + if (jsonObj.get("fromMerchant") != null && !jsonObj.get("fromMerchant").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `fromMerchant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fromMerchant").toString())); + } + // validate the optional field pspReference + if (jsonObj.get("pspReference") != null && !jsonObj.get("pspReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); + } + // ensure the field status can be parsed to an enum value + if (jsonObj.get("status") != null) { + if(!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + StatusEnum.fromValue(jsonObj.get("status").getAsString()); + } + // validate the optional field toMerchant + if (jsonObj.get("toMerchant") != null && !jsonObj.get("toMerchant").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `toMerchant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("toMerchant").toString())); + } + // ensure the field type can be parsed to an enum value + if (jsonObj.get("type") != null) { + if(!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + TypeEnum.fromValue(jsonObj.get("type").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BalanceTransferResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BalanceTransferResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BalanceTransferResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BalanceTransferResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BalanceTransferResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BalanceTransferResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of BalanceTransferResponse + * @throws IOException if the JSON string is invalid with respect to BalanceTransferResponse + */ + public static BalanceTransferResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BalanceTransferResponse.class); + } + + /** + * Convert an instance of BalanceTransferResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/balancecontrol/JSON.java b/src/main/java/com/adyen/model/balancecontrol/JSON.java new file mode 100644 index 000000000..458e4c3a0 --- /dev/null +++ b/src/main/java/com/adyen/model/balancecontrol/JSON.java @@ -0,0 +1,402 @@ +/* + * Adyen Balance Control API + * The Balance Control API lets you transfer funds between merchant accounts that belong to the same legal entity and are under the same company account. ## Authentication To connect to the Balance Control API, you must authenticate your requests with an [API key or basic auth username and password](https://docs.adyen.com/development-resources/api-authentication). To learn how you can generate these, see [API credentials](https://docs.adyen.com/development-resources/api-credentials).Here is an example of authenticating a request with an API key: ``` curl -H \"X-API-Key: Your_API_key\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate API credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning The Balance Control API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BalanceControl/v1/balanceTransfer ``` + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balancecontrol; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import org.apache.commons.codec.binary.Base64; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balancecontrol.Amount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balancecontrol.BalanceTransferRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balancecontrol.BalanceTransferResponse.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(new String(value)); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + return Base64.decodeBase64(bytesAsBase64); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/src/main/java/com/adyen/model/dataprotection/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/dataprotection/AbstractOpenApiSchema.java new file mode 100644 index 000000000..7b8ee691d --- /dev/null +++ b/src/main/java/com/adyen/model/dataprotection/AbstractOpenApiSchema.java @@ -0,0 +1,145 @@ +/* + * Adyen Data Protection API + * Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email).## Authentication Each request to the Data Protection API must be signed with an API key. Get your API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Data Protection Service API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://ca-test.adyen.com/ca/services/DataProtectionService/v1/requestSubjectErasure ``` + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.dataprotection; + +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import jakarta.ws.rs.core.GenericType; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/src/main/java/com/adyen/model/dataprotection/JSON.java b/src/main/java/com/adyen/model/dataprotection/JSON.java new file mode 100644 index 000000000..108db5b92 --- /dev/null +++ b/src/main/java/com/adyen/model/dataprotection/JSON.java @@ -0,0 +1,402 @@ +/* + * Adyen Data Protection API + * Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email).## Authentication Each request to the Data Protection API must be signed with an API key. Get your API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Data Protection Service API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://ca-test.adyen.com/ca/services/DataProtectionService/v1/requestSubjectErasure ``` + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.dataprotection; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import org.apache.commons.codec.binary.Base64; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.dataprotection.ServiceError.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.dataprotection.SubjectErasureByPspReferenceRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.dataprotection.SubjectErasureResponse.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(new String(value)); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + return Base64.decodeBase64(bytesAsBase64); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/src/main/java/com/adyen/model/dataprotection/ServiceError.java b/src/main/java/com/adyen/model/dataprotection/ServiceError.java new file mode 100644 index 000000000..10e4f8d84 --- /dev/null +++ b/src/main/java/com/adyen/model/dataprotection/ServiceError.java @@ -0,0 +1,337 @@ +/* + * Adyen Data Protection API + * Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email).## Authentication Each request to the Data Protection API must be signed with an API key. Get your API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Data Protection Service API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://ca-test.adyen.com/ca/services/DataProtectionService/v1/requestSubjectErasure ``` + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.dataprotection; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.dataprotection.JSON; + +/** + * ServiceError + */ + +public class ServiceError { + public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode"; + @SerializedName(SERIALIZED_NAME_ERROR_CODE) + private String errorCode; + + public static final String SERIALIZED_NAME_ERROR_TYPE = "errorType"; + @SerializedName(SERIALIZED_NAME_ERROR_TYPE) + private String errorType; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_PSP_REFERENCE = "pspReference"; + @SerializedName(SERIALIZED_NAME_PSP_REFERENCE) + private String pspReference; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Integer status; + + public ServiceError() { + } + + public ServiceError errorCode(String errorCode) { + + this.errorCode = errorCode; + return this; + } + + /** + * The error code mapped to the error message. + * @return errorCode + **/ + @ApiModelProperty(value = "The error code mapped to the error message.") + + public String getErrorCode() { + return errorCode; + } + + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + + public ServiceError errorType(String errorType) { + + this.errorType = errorType; + return this; + } + + /** + * The category of the error. + * @return errorType + **/ + @ApiModelProperty(value = "The category of the error.") + + public String getErrorType() { + return errorType; + } + + + public void setErrorType(String errorType) { + this.errorType = errorType; + } + + + public ServiceError message(String message) { + + this.message = message; + return this; + } + + /** + * A short explanation of the issue. + * @return message + **/ + @ApiModelProperty(value = "A short explanation of the issue.") + + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ServiceError pspReference(String pspReference) { + + this.pspReference = pspReference; + return this; + } + + /** + * The PSP reference of the payment. + * @return pspReference + **/ + @ApiModelProperty(value = "The PSP reference of the payment.") + + public String getPspReference() { + return pspReference; + } + + + public void setPspReference(String pspReference) { + this.pspReference = pspReference; + } + + + public ServiceError status(Integer status) { + + this.status = status; + return this; + } + + /** + * The HTTP response status. + * @return status + **/ + @ApiModelProperty(value = "The HTTP response status.") + + public Integer getStatus() { + return status; + } + + + public void setStatus(Integer status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceError serviceError = (ServiceError) o; + return Objects.equals(this.errorCode, serviceError.errorCode) && + Objects.equals(this.errorType, serviceError.errorType) && + Objects.equals(this.message, serviceError.message) && + Objects.equals(this.pspReference, serviceError.pspReference) && + Objects.equals(this.status, serviceError.status); + } + + @Override + public int hashCode() { + return Objects.hash(errorCode, errorType, message, pspReference, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceError {\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" errorType: ").append(toIndentedString(errorType)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("errorCode"); + openapiFields.add("errorType"); + openapiFields.add("message"); + openapiFields.add("pspReference"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ServiceError + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ServiceError.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ServiceError is not found in the empty JSON string", ServiceError.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ServiceError.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ServiceError` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field errorCode + if (jsonObj.get("errorCode") != null && !jsonObj.get("errorCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); + } + // validate the optional field errorType + if (jsonObj.get("errorType") != null && !jsonObj.get("errorType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorType").toString())); + } + // validate the optional field message + if (jsonObj.get("message") != null && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the optional field pspReference + if (jsonObj.get("pspReference") != null && !jsonObj.get("pspReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ServiceError.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ServiceError' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ServiceError.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ServiceError value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ServiceError read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ServiceError given an JSON string + * + * @param jsonString JSON string + * @return An instance of ServiceError + * @throws IOException if the JSON string is invalid with respect to ServiceError + */ + public static ServiceError fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ServiceError.class); + } + + /** + * Convert an instance of ServiceError to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/dataprotection/SubjectErasureByPspReferenceRequest.java b/src/main/java/com/adyen/model/dataprotection/SubjectErasureByPspReferenceRequest.java new file mode 100644 index 000000000..f21e933b0 --- /dev/null +++ b/src/main/java/com/adyen/model/dataprotection/SubjectErasureByPspReferenceRequest.java @@ -0,0 +1,271 @@ +/* + * Adyen Data Protection API + * Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email).## Authentication Each request to the Data Protection API must be signed with an API key. Get your API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Data Protection Service API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://ca-test.adyen.com/ca/services/DataProtectionService/v1/requestSubjectErasure ``` + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.dataprotection; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.dataprotection.JSON; + +/** + * SubjectErasureByPspReferenceRequest + */ + +public class SubjectErasureByPspReferenceRequest { + public static final String SERIALIZED_NAME_FORCE_ERASURE = "forceErasure"; + @SerializedName(SERIALIZED_NAME_FORCE_ERASURE) + private Boolean forceErasure; + + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT = "merchantAccount"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) + private String merchantAccount; + + public static final String SERIALIZED_NAME_PSP_REFERENCE = "pspReference"; + @SerializedName(SERIALIZED_NAME_PSP_REFERENCE) + private String pspReference; + + public SubjectErasureByPspReferenceRequest() { + } + + public SubjectErasureByPspReferenceRequest forceErasure(Boolean forceErasure) { + + this.forceErasure = forceErasure; + return this; + } + + /** + * Set this to **true** if you want to delete shopper-related data, even if the shopper has an existing recurring transaction. This only deletes the shopper-related data for the specific payment, but does not cancel the existing recurring transaction. + * @return forceErasure + **/ + @ApiModelProperty(value = "Set this to **true** if you want to delete shopper-related data, even if the shopper has an existing recurring transaction. This only deletes the shopper-related data for the specific payment, but does not cancel the existing recurring transaction.") + + public Boolean getForceErasure() { + return forceErasure; + } + + + public void setForceErasure(Boolean forceErasure) { + this.forceErasure = forceErasure; + } + + + public SubjectErasureByPspReferenceRequest merchantAccount(String merchantAccount) { + + this.merchantAccount = merchantAccount; + return this; + } + + /** + * Your merchant account + * @return merchantAccount + **/ + @ApiModelProperty(value = "Your merchant account") + + public String getMerchantAccount() { + return merchantAccount; + } + + + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } + + + public SubjectErasureByPspReferenceRequest pspReference(String pspReference) { + + this.pspReference = pspReference; + return this; + } + + /** + * The PSP reference of the payment. We will delete all shopper-related data for this payment. + * @return pspReference + **/ + @ApiModelProperty(value = "The PSP reference of the payment. We will delete all shopper-related data for this payment.") + + public String getPspReference() { + return pspReference; + } + + + public void setPspReference(String pspReference) { + this.pspReference = pspReference; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubjectErasureByPspReferenceRequest subjectErasureByPspReferenceRequest = (SubjectErasureByPspReferenceRequest) o; + return Objects.equals(this.forceErasure, subjectErasureByPspReferenceRequest.forceErasure) && + Objects.equals(this.merchantAccount, subjectErasureByPspReferenceRequest.merchantAccount) && + Objects.equals(this.pspReference, subjectErasureByPspReferenceRequest.pspReference); + } + + @Override + public int hashCode() { + return Objects.hash(forceErasure, merchantAccount, pspReference); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubjectErasureByPspReferenceRequest {\n"); + sb.append(" forceErasure: ").append(toIndentedString(forceErasure)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("forceErasure"); + openapiFields.add("merchantAccount"); + openapiFields.add("pspReference"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SubjectErasureByPspReferenceRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SubjectErasureByPspReferenceRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SubjectErasureByPspReferenceRequest is not found in the empty JSON string", SubjectErasureByPspReferenceRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SubjectErasureByPspReferenceRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SubjectErasureByPspReferenceRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field merchantAccount + if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); + } + // validate the optional field pspReference + if (jsonObj.get("pspReference") != null && !jsonObj.get("pspReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubjectErasureByPspReferenceRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubjectErasureByPspReferenceRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubjectErasureByPspReferenceRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubjectErasureByPspReferenceRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubjectErasureByPspReferenceRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SubjectErasureByPspReferenceRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubjectErasureByPspReferenceRequest + * @throws IOException if the JSON string is invalid with respect to SubjectErasureByPspReferenceRequest + */ + public static SubjectErasureByPspReferenceRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubjectErasureByPspReferenceRequest.class); + } + + /** + * Convert an instance of SubjectErasureByPspReferenceRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/dataprotection/SubjectErasureRequest.java b/src/main/java/com/adyen/model/dataprotection/SubjectErasureRequest.java deleted file mode 100644 index 1c8f3d4ba..000000000 --- a/src/main/java/com/adyen/model/dataprotection/SubjectErasureRequest.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ - * - * Adyen Java API Library - * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. - */ - -package com.adyen.model.dataprotection; - -import java.util.Objects; - -import com.google.gson.annotations.SerializedName; - -/** - * SubjectErasureRequest - */ - -public class SubjectErasureRequest { - @SerializedName("forceErasure") - private Boolean forceErasure = null; - - @SerializedName("merchantAccount") - private String merchantAccount = null; - - @SerializedName("pspReference") - private String pspReference = null; - - public SubjectErasureRequest forceErasure(Boolean forceErasure) { - this.forceErasure = forceErasure; - return this; - } - - /** - * Get forceErasure - * - * @return forceErasure - **/ - public Boolean isForceErasure() { - return forceErasure; - } - - public void setForceErasure(Boolean forceErasure) { - this.forceErasure = forceErasure; - } - - public SubjectErasureRequest merchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - return this; - } - - /** - * Get merchantAccount - * - * @return merchantAccount - **/ - public String getMerchantAccount() { - return merchantAccount; - } - - public void setMerchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - } - - public SubjectErasureRequest pspReference(String pspReference) { - this.pspReference = pspReference; - return this; - } - - /** - * Get pspReference - * - * @return pspReference - **/ - public String getPspReference() { - return pspReference; - } - - public void setPspReference(String pspReference) { - this.pspReference = pspReference; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SubjectErasureRequest subjectErasureRequest = (SubjectErasureRequest) o; - return Objects.equals(this.forceErasure, subjectErasureRequest.forceErasure) && - Objects.equals(this.merchantAccount, subjectErasureRequest.merchantAccount) && - Objects.equals(this.pspReference, subjectErasureRequest.pspReference); - } - - @Override - public int hashCode() { - return Objects.hash(forceErasure, merchantAccount, pspReference); - } - - - @Override - public String toString() { - return "class SubjectErasureRequest {\n" + - " forceErasure: " + toIndentedString(forceErasure) + "\n" + - " merchantAccount: " + toIndentedString(merchantAccount) + "\n" + - " pspReference: " + toIndentedString(pspReference) + "\n" + - "}"; - } - - /** - * 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 "); - } - -} \ No newline at end of file diff --git a/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java b/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java index ac91fb29e..19481f7a5 100644 --- a/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java +++ b/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java @@ -1,144 +1,263 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * Adyen Data Protection API + * Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email).## Authentication Each request to the Data Protection API must be signed with an API key. Get your API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Data Protection Service API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://ca-test.adyen.com/ca/services/DataProtectionService/v1/requestSubjectErasure ``` * - * Adyen Java API Library + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.dataprotection; import java.util.Objects; - +import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; - +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.dataprotection.JSON; + /** * SubjectErasureResponse */ + public class SubjectErasureResponse { - /** - * Gets or Sets result - */ - @JsonAdapter(ResultEnum.Adapter.class) - public enum ResultEnum { - ACTIVE_RECURRING_TOKEN_EXISTS("ACTIVE_RECURRING_TOKEN_EXISTS"), - ALREADY_PROCESSED("ALREADY_PROCESSED"), - PAYMENT_NOT_FOUND("PAYMENT_NOT_FOUND"), - SUCCESS("SUCCESS"); - - private final String value; - - ResultEnum(String value) { - this.value = value; - } + /** + * The result of this operation. + */ + @JsonAdapter(ResultEnum.Adapter.class) + public enum ResultEnum { + ACTIVE_RECURRING_TOKEN_EXISTS("ACTIVE_RECURRING_TOKEN_EXISTS"), + + ALREADY_PROCESSED("ALREADY_PROCESSED"), + + PAYMENT_NOT_FOUND("PAYMENT_NOT_FOUND"), + + SUCCESS("SUCCESS"); - public String getValue() { - return value; - } + private String value; - @Override - public String toString() { - return String.valueOf(value); - } + ResultEnum(String value) { + this.value = value; + } - public static ResultEnum fromValue(String text) { - for (ResultEnum b : ResultEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final ResultEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public ResultEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return ResultEnum.fromValue(String.valueOf(value)); - } + public static ResultEnum fromValue(String value) { + for (ResultEnum b : ResultEnum.values()) { + if (b.value.equals(value)) { + return b; } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - @SerializedName("result") - private ResultEnum result = null; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResultEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - public SubjectErasureResponse result(ResultEnum result) { - this.result = result; - return this; + @Override + public ResultEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResultEnum.fromValue(value); + } } + } + + public static final String SERIALIZED_NAME_RESULT = "result"; + @SerializedName(SERIALIZED_NAME_RESULT) + private ResultEnum result; + + public SubjectErasureResponse() { + } + + public SubjectErasureResponse result(ResultEnum result) { + + this.result = result; + return this; + } + + /** + * The result of this operation. + * @return result + **/ + @ApiModelProperty(value = "The result of this operation.") + + public ResultEnum getResult() { + return result; + } - /** - * Get result - * - * @return result - **/ - public ResultEnum getResult() { - return result; + + public void setResult(ResultEnum result) { + this.result = result; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } + SubjectErasureResponse subjectErasureResponse = (SubjectErasureResponse) o; + return Objects.equals(this.result, subjectErasureResponse.result); + } + + @Override + public int hashCode() { + return Objects.hash(result); + } - public void setResult(ResultEnum result) { - this.result = result; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubjectErasureResponse {\n"); + sb.append(" result: ").append(toIndentedString(result)).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 "); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("result"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SubjectErasureResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SubjectErasureResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SubjectErasureResponse is not found in the empty JSON string", SubjectErasureResponse.openapiRequiredFields.toString())); } - if (o == null || getClass() != o.getClass()) { - return false; + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SubjectErasureResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SubjectErasureResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - SubjectErasureResponse subjectErasureResponse = (SubjectErasureResponse) o; - return Objects.equals(this.result, subjectErasureResponse.result); - } + } + // ensure the field result can be parsed to an enum value + if (jsonObj.get("result") != null) { + if(!jsonObj.get("result").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `result` to be a primitive type in the JSON string but got `%s`", jsonObj.get("result").toString())); + } + ResultEnum.fromValue(jsonObj.get("result").getAsString()); + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") @Override - public int hashCode() { - return Objects.hash(result); - } + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubjectErasureResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubjectErasureResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SubjectErasureResponse.class)); + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SubjectErasureResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } - @Override - public String toString() { - return "class SubjectErasureResponse {\n" + - " result: " + toIndentedString(result) + "\n" + - "}"; - } + @Override + public SubjectErasureResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } - /** - * 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 "); + }.nullSafe(); } + } + + /** + * Create an instance of SubjectErasureResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubjectErasureResponse + * @throws IOException if the JSON string is invalid with respect to SubjectErasureResponse + */ + public static SubjectErasureResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SubjectErasureResponse.class); + } + + /** + * Convert an instance of SubjectErasureResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} -} \ No newline at end of file diff --git a/src/main/java/com/adyen/service/BalanceControlApi.java b/src/main/java/com/adyen/service/BalanceControlApi.java new file mode 100644 index 000000000..4251425be --- /dev/null +++ b/src/main/java/com/adyen/service/BalanceControlApi.java @@ -0,0 +1,62 @@ +/* + * Adyen Balance Control API + * The Balance Control API lets you transfer funds between merchant accounts that belong to the same legal entity and are under the same company account. ## Authentication To connect to the Balance Control API, you must authenticate your requests with an [API key or basic auth username and password](https://docs.adyen.com/development-resources/api-authentication). To learn how you can generate these, see [API credentials](https://docs.adyen.com/development-resources/api-credentials).Here is an example of authenticating a request with an API key: ``` curl -H \"X-API-Key: Your_API_key\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate API credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning The Balance Control API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BalanceControl/v1/balanceTransfer ``` + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.balancecontrol.BalanceTransferRequest; +import com.adyen.model.balancecontrol.BalanceTransferResponse; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class BalanceControlApi extends Service { + private final String baseURL; + + public BalanceControlApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://pal-test.adyen.com/pal/servlet/BalanceControl/v1"); + } + + /** + * Start a balance transfer + * + * @param balanceTransferRequest {@link BalanceTransferRequest } (required) + * @return {@link BalanceTransferResponse } + * @throws ApiException if fails to make API call + */ + public BalanceTransferResponse balanceTransfer(BalanceTransferRequest balanceTransferRequest) throws ApiException, IOException { + return balanceTransfer(balanceTransferRequest, null); + } + + /** + * Start a balance transfer + * + * @param balanceTransferRequest {@link BalanceTransferRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link BalanceTransferResponse } + * @throws ApiException if fails to make API call + */ + public BalanceTransferResponse balanceTransfer(BalanceTransferRequest balanceTransferRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = balanceTransferRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/balanceTransfer", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return BalanceTransferResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/DataProtection.java b/src/main/java/com/adyen/service/DataProtection.java deleted file mode 100644 index 4604dd56b..000000000 --- a/src/main/java/com/adyen/service/DataProtection.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ - * - * Adyen Java API Library - * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. - */ -package com.adyen.service; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.model.RequestOptions; -import com.adyen.model.dataprotection.SubjectErasureRequest; -import com.adyen.model.dataprotection.SubjectErasureResponse; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.dataprotection.RequestSubjectErasure; -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - -public class DataProtection extends Service { - - private final RequestSubjectErasure requestSubjectErasure; - - public DataProtection(Client client) { - super(client); - requestSubjectErasure = new RequestSubjectErasure(this); - } - - /** - * POST /requestSubjectErasure API call - * - * @param subjectErasureRequest subjectErasureRequest - * @return subjectErasureResponse - * @throws ApiException ApiException - * @throws IOException IOException - */ - public SubjectErasureResponse requestSubjectErasure(SubjectErasureRequest subjectErasureRequest) throws ApiException, IOException { - return requestSubjectErasure(subjectErasureRequest, null); - } - - public SubjectErasureResponse requestSubjectErasure(SubjectErasureRequest subjectErasureRequest, RequestOptions requestOptions) throws ApiException, IOException { - String jsonRequest = GSON.toJson(subjectErasureRequest); - String jsonResult = requestSubjectErasure.request(jsonRequest, requestOptions); - return GSON.fromJson(jsonResult, new TypeToken() { - }.getType()); - } - -} diff --git a/src/main/java/com/adyen/service/DataProtectionApi.java b/src/main/java/com/adyen/service/DataProtectionApi.java new file mode 100644 index 000000000..43ded4956 --- /dev/null +++ b/src/main/java/com/adyen/service/DataProtectionApi.java @@ -0,0 +1,63 @@ +/* + * Adyen Data Protection API + * Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email).## Authentication Each request to the Data Protection API must be signed with an API key. Get your API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Data Protection Service API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://ca-test.adyen.com/ca/services/DataProtectionService/v1/requestSubjectErasure ``` + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.dataprotection.ServiceError; +import com.adyen.model.dataprotection.SubjectErasureByPspReferenceRequest; +import com.adyen.model.dataprotection.SubjectErasureResponse; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class DataProtectionApi extends Service { + private final String baseURL; + + public DataProtectionApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://ca-test.adyen.com/ca/services/DataProtectionService/v1"); + } + + /** + * Submit a Subject Erasure Request. + * + * @param subjectErasureByPspReferenceRequest {@link SubjectErasureByPspReferenceRequest } (required) + * @return {@link SubjectErasureResponse } + * @throws ApiException if fails to make API call + */ + public SubjectErasureResponse requestSubjectErasure(SubjectErasureByPspReferenceRequest subjectErasureByPspReferenceRequest) throws ApiException, IOException { + return requestSubjectErasure(subjectErasureByPspReferenceRequest, null); + } + + /** + * Submit a Subject Erasure Request. + * + * @param subjectErasureByPspReferenceRequest {@link SubjectErasureByPspReferenceRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link SubjectErasureResponse } + * @throws ApiException if fails to make API call + */ + public SubjectErasureResponse requestSubjectErasure(SubjectErasureByPspReferenceRequest subjectErasureByPspReferenceRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = subjectErasureByPspReferenceRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/requestSubjectErasure", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return SubjectErasureResponse.fromJson(jsonResult); + } +} diff --git a/src/test/java/com/adyen/BalanceControlTest.java b/src/test/java/com/adyen/BalanceControlTest.java new file mode 100644 index 000000000..6ea2134e9 --- /dev/null +++ b/src/test/java/com/adyen/BalanceControlTest.java @@ -0,0 +1,37 @@ +package com.adyen; + +import com.adyen.constants.ApiConstants; +import com.adyen.httpclient.HTTPClientException; +import com.adyen.model.balancecontrol.BalanceTransferRequest; +import com.adyen.model.balancecontrol.BalanceTransferResponse; +import com.adyen.service.BalanceControlApi; +import com.adyen.service.exception.ApiException; +import org.junit.Test; + +import java.io.IOException; +import java.time.OffsetDateTime; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.verify; + +public class BalanceControlTest extends BaseTest { + + @Test + public void TestBalanceControlApi() throws IOException, ApiException, HTTPClientException { + Client client = createMockClientFromFile("mocks/smallendpoints/balance-control.json"); + BalanceControlApi service = new BalanceControlApi(client); + BalanceTransferResponse response = service.balanceTransfer(new BalanceTransferRequest()); + + verify(client.getHttpClient()).request( + "https://pal-test.adyen.com/pal/servlet/BalanceControl/v1/balanceTransfer", + "{}", + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.POST, + null + ); + assertEquals(response.getStatus(), BalanceTransferResponse.StatusEnum.TRANSFERRED); + assertEquals(response.getCreatedAt(), OffsetDateTime.parse("2022-01-24T14:59:11+01:00")); + } +} diff --git a/src/test/java/com/adyen/DataProtectionServiceTest.java b/src/test/java/com/adyen/DataProtectionServiceTest.java index b461d9d45..2fa6f32b3 100644 --- a/src/test/java/com/adyen/DataProtectionServiceTest.java +++ b/src/test/java/com/adyen/DataProtectionServiceTest.java @@ -20,15 +20,17 @@ */ package com.adyen; -import com.adyen.model.dataprotection.SubjectErasureRequest; +import com.adyen.constants.ApiConstants; +import com.adyen.model.dataprotection.SubjectErasureByPspReferenceRequest; import com.adyen.model.dataprotection.SubjectErasureResponse; -import com.adyen.service.DataProtection; +import com.adyen.service.DataProtectionApi; import com.adyen.service.exception.ApiException; import org.junit.Test; import java.io.IOException; import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.verify; public class DataProtectionServiceTest extends BaseTest { /** @@ -37,16 +39,25 @@ public class DataProtectionServiceTest extends BaseTest { @Test public void TestRequestSubjectErasureSuccessMocked() throws Exception { Client client = createMockClientFromFile("mocks/request-subject-erasure-success.json"); - DataProtection dataProtection = new DataProtection(client); - SubjectErasureRequest subjectErasureRequest = createSubjectErasureRequest(); + DataProtectionApi dataProtection = new DataProtectionApi(client); + SubjectErasureByPspReferenceRequest subjectErasureRequest = new SubjectErasureByPspReferenceRequest(); SubjectErasureResponse subjectErasureResponse = dataProtection.requestSubjectErasure(subjectErasureRequest); + verify(client.getHttpClient()).request( + "https://ca-test.adyen.com/ca/services/DataProtectionService/v1/requestSubjectErasure", + "{}", + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.POST, + null + ); assertEquals(SubjectErasureResponse.ResultEnum.SUCCESS, subjectErasureResponse.getResult()); } - protected SubjectErasureRequest createSubjectErasureRequest() { - SubjectErasureRequest subjectErasureRequest = new SubjectErasureRequest(); + protected SubjectErasureByPspReferenceRequest createSubjectErasureRequest() { + SubjectErasureByPspReferenceRequest subjectErasureRequest = new SubjectErasureByPspReferenceRequest(); subjectErasureRequest.setForceErasure(false); subjectErasureRequest.setMerchantAccount("Test"); subjectErasureRequest.setPspReference("123456"); @@ -57,8 +68,8 @@ protected SubjectErasureRequest createSubjectErasureRequest() { @Test public void TestGetAuthenticationResultErrorNotFound() throws IOException, ApiException { Client client = createMockClientFromFile("mocks/request-subject-erasure-not-found.json"); - DataProtection dataProtection = new DataProtection(client); - SubjectErasureRequest subjectErasureRequest = createSubjectErasureRequest(); + DataProtectionApi dataProtection = new DataProtectionApi(client); + SubjectErasureByPspReferenceRequest subjectErasureRequest = createSubjectErasureRequest(); SubjectErasureResponse subjectErasureResponse = dataProtection.requestSubjectErasure(subjectErasureRequest); diff --git a/src/test/resources/mocks/smallendpoints/balance-control.json b/src/test/resources/mocks/smallendpoints/balance-control.json new file mode 100644 index 000000000..aae62b7d8 --- /dev/null +++ b/src/test/resources/mocks/smallendpoints/balance-control.json @@ -0,0 +1,14 @@ +{ + "amount": { + "value": 50000, + "currency": "EUR" + }, + "createdAt": "2022-01-24T14:59:11+01:00", + "description": "Your description for the transfer", + "fromMerchant": "MerchantAccount_NL", + "toMerchant": "MerchantAccount_DE", + "type": "debit", + "reference": "Unique reference for the transfer", + "pspReference": "8816080397613514", + "status": "transferred" +} \ No newline at end of file From 5d8848e4c77f60b7c4d6debfcae70d659df7f1ab Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Mon, 8 May 2023 11:44:17 +0200 Subject: [PATCH 27/32] [ITT-498] Regenerate Management and Recurring (#1008) * regenerate management API * regenerate recurring * only ignore unused imports on services --- checkstyle-suppressions.xml | 2 +- .../java/com/adyen/service/Recurring.java | 148 ------ .../java/com/adyen/service/RecurringApi.java | 208 ++++++++ .../management/AccountCompanyLevel.java | 99 ---- .../management/AccountCompanyLevelApi.java | 147 ++++++ .../management/AccountMerchantLevel.java | 115 ----- .../management/AccountMerchantLevelApi.java | 166 +++++++ .../service/management/AccountStoreLevel.java | 218 --------- .../management/AccountStoreLevelApi.java | 338 +++++++++++++ .../AllowedOriginsCompanyLevel.java | 147 ------ .../AllowedOriginsCompanyLevelApi.java | 202 ++++++++ .../AllowedOriginsMerchantLevel.java | 147 ------ .../AllowedOriginsMerchantLevelApi.java | 202 ++++++++ .../ApiCredentialsCompanyLevel.java | 136 ------ .../ApiCredentialsCompanyLevelApi.java | 196 ++++++++ .../ApiCredentialsMerchantLevel.java | 136 ------ .../ApiCredentialsMerchantLevelApi.java | 196 ++++++++ .../management/ApiKeyCompanyLevel.java | 59 --- .../management/ApiKeyCompanyLevelApi.java | 73 +++ .../management/ApiKeyMerchantLevel.java | 59 --- .../management/ApiKeyMerchantLevelApi.java | 73 +++ .../management/ClientKeyCompanyLevel.java | 59 --- .../management/ClientKeyCompanyLevelApi.java | 73 +++ .../management/ClientKeyMerchantLevel.java | 59 --- .../management/ClientKeyMerchantLevelApi.java | 73 +++ .../service/management/MyApiCredential.java | 125 ----- .../management/MyApiCredentialApi.java | 177 +++++++ .../PaymentMethodsMerchantLevel.java | 189 -------- .../PaymentMethodsMerchantLevelApi.java | 281 +++++++++++ .../PayoutSettingsMerchantLevel.java | 156 ------ .../PayoutSettingsMerchantLevelApi.java | 221 +++++++++ .../TerminalActionsCompanyLevel.java | 136 ------ .../TerminalActionsCompanyLevelApi.java | 213 +++++++++ .../TerminalActionsTerminalLevel.java | 51 -- .../TerminalActionsTerminalLevelApi.java | 62 +++ .../TerminalOrdersCompanyLevel.java | 284 ----------- .../TerminalOrdersCompanyLevelApi.java | 452 ++++++++++++++++++ .../TerminalOrdersMerchantLevel.java | 284 ----------- .../TerminalOrdersMerchantLevelApi.java | 452 ++++++++++++++++++ .../TerminalSettingsCompanyLevel.java | 124 ----- .../TerminalSettingsCompanyLevelApi.java | 185 +++++++ .../TerminalSettingsMerchantLevel.java | 124 ----- .../TerminalSettingsMerchantLevelApi.java | 185 +++++++ .../TerminalSettingsStoreLevel.java | 234 --------- .../TerminalSettingsStoreLevelApi.java | 359 ++++++++++++++ .../TerminalSettingsTerminalLevel.java | 120 ----- .../TerminalSettingsTerminalLevelApi.java | 171 +++++++ .../management/TerminalsTerminalLevel.java | 57 --- .../management/TerminalsTerminalLevelApi.java | 89 ++++ .../service/management/UsersCompanyLevel.java | 136 ------ .../management/UsersCompanyLevelApi.java | 200 ++++++++ .../management/UsersMerchantLevel.java | 136 ------ .../management/UsersMerchantLevelApi.java | 200 ++++++++ .../management/WebhooksCompanyLevel.java | 215 --------- .../management/WebhooksCompanyLevelApi.java | 314 ++++++++++++ .../management/WebhooksMerchantLevel.java | 215 --------- .../management/WebhooksMerchantLevelApi.java | 314 ++++++++++++ .../java/com/adyen/ErrorHandlingTest.java | 4 +- src/test/java/com/adyen/ManagementTest.java | 38 +- src/test/java/com/adyen/RecurringTest.java | 18 +- 60 files changed, 5853 insertions(+), 3999 deletions(-) delete mode 100644 src/main/java/com/adyen/service/Recurring.java create mode 100644 src/main/java/com/adyen/service/RecurringApi.java delete mode 100644 src/main/java/com/adyen/service/management/AccountCompanyLevel.java create mode 100644 src/main/java/com/adyen/service/management/AccountCompanyLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/AccountMerchantLevel.java create mode 100644 src/main/java/com/adyen/service/management/AccountMerchantLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/AccountStoreLevel.java create mode 100644 src/main/java/com/adyen/service/management/AccountStoreLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevel.java create mode 100644 src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevel.java create mode 100644 src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevel.java create mode 100644 src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevel.java create mode 100644 src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/ApiKeyCompanyLevel.java create mode 100644 src/main/java/com/adyen/service/management/ApiKeyCompanyLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/ApiKeyMerchantLevel.java create mode 100644 src/main/java/com/adyen/service/management/ApiKeyMerchantLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/ClientKeyCompanyLevel.java create mode 100644 src/main/java/com/adyen/service/management/ClientKeyCompanyLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/ClientKeyMerchantLevel.java create mode 100644 src/main/java/com/adyen/service/management/ClientKeyMerchantLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/MyApiCredential.java create mode 100644 src/main/java/com/adyen/service/management/MyApiCredentialApi.java delete mode 100644 src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevel.java create mode 100644 src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevel.java create mode 100644 src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/TerminalActionsCompanyLevel.java create mode 100644 src/main/java/com/adyen/service/management/TerminalActionsCompanyLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/TerminalActionsTerminalLevel.java create mode 100644 src/main/java/com/adyen/service/management/TerminalActionsTerminalLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevel.java create mode 100644 src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevel.java create mode 100644 src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevel.java create mode 100644 src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevel.java create mode 100644 src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/TerminalSettingsStoreLevel.java create mode 100644 src/main/java/com/adyen/service/management/TerminalSettingsStoreLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevel.java create mode 100644 src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/TerminalsTerminalLevel.java create mode 100644 src/main/java/com/adyen/service/management/TerminalsTerminalLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/UsersCompanyLevel.java create mode 100644 src/main/java/com/adyen/service/management/UsersCompanyLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/UsersMerchantLevel.java create mode 100644 src/main/java/com/adyen/service/management/UsersMerchantLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/WebhooksCompanyLevel.java create mode 100644 src/main/java/com/adyen/service/management/WebhooksCompanyLevelApi.java delete mode 100644 src/main/java/com/adyen/service/management/WebhooksMerchantLevel.java create mode 100644 src/main/java/com/adyen/service/management/WebhooksMerchantLevelApi.java diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml index 0c39a6b59..995fa2466 100644 --- a/checkstyle-suppressions.xml +++ b/checkstyle-suppressions.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/src/main/java/com/adyen/service/Recurring.java b/src/main/java/com/adyen/service/Recurring.java deleted file mode 100644 index 084b99ed4..000000000 --- a/src/main/java/com/adyen/service/Recurring.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ - * - * Adyen Java API Library - * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. - */ -package com.adyen.service; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.model.recurring.DisableRequest; -import com.adyen.model.recurring.DisableResult; -import com.adyen.model.recurring.NotifyShopperRequest; -import com.adyen.model.recurring.NotifyShopperResult; -import com.adyen.model.recurring.RecurringDetailsRequest; -import com.adyen.model.recurring.RecurringDetailsResult; -import com.adyen.model.recurring.ScheduleAccountUpdaterRequest; -import com.adyen.model.recurring.ScheduleAccountUpdaterResult; -import com.adyen.model.recurring.CreatePermitRequest; -import com.adyen.model.recurring.CreatePermitResult; -import com.adyen.model.recurring.DisablePermitRequest; -import com.adyen.model.recurring.DisablePermitResult; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.recurring.Disable; -import com.adyen.service.resource.recurring.ListRecurringDetails; -import com.adyen.service.resource.recurring.NotifyShopper; -import com.adyen.service.resource.recurring.ScheduleAccountUpdater; -import com.adyen.service.resource.recurring.CreatePermit; -import com.adyen.service.resource.recurring.DisablePermit; -import java.io.IOException; - -public class Recurring extends Service { - private final ListRecurringDetails listRecurringDetails; - private final Disable disable; - private final ScheduleAccountUpdater scheduleAccountUpdater; - private final NotifyShopper notifyShopper; - private final CreatePermit createPermit; - private final DisablePermit disablePermit; - - public Recurring(Client client) { - super(client); - - listRecurringDetails = new ListRecurringDetails(this); - disable = new Disable(this); - scheduleAccountUpdater = new ScheduleAccountUpdater(this); - notifyShopper = new NotifyShopper(this); - createPermit = new CreatePermit(this); - disablePermit = new DisablePermit(this); - } - - /** - * Issues a listRecurringDetails API call - * - * @param request RecurringDetailsResult - * @return recurring details result - * @throws IOException IOException - * @throws ApiException ApiException - */ - public RecurringDetailsResult listRecurringDetails(RecurringDetailsRequest request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - String jsonResult = listRecurringDetails.request(jsonRequest); - return RecurringDetailsResult.fromJson(jsonResult); - } - - /** - * Issues a disable recurring contract API call - * - * @param request DisableRequest - * @return DisableResult - * @throws IOException IOException - * @throws ApiException ApiException - */ - public DisableResult disable(DisableRequest request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - String jsonResult = disable.request(jsonRequest); - return DisableResult.fromJson(jsonResult); - } - - /** - * Issues a scheduleAccountUpdate API call - * - * @param request ScheduleAccountUpdaterRequest - * @return ScheduleAccountUpdaterResult - * @throws IOException IOException - * @throws ApiException ApiException - */ - public ScheduleAccountUpdaterResult scheduleAccountUpdater(ScheduleAccountUpdaterRequest request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - String jsonResult = scheduleAccountUpdater.request(jsonRequest); - return ScheduleAccountUpdaterResult.fromJson(jsonResult); - } - - /** - * Issues a notifyShopper API call - * - * @param request NotifyShopperRequest - * @return NotifyShopperResult - * @throws IOException IOException - * @throws ApiException ApiException - */ - public NotifyShopperResult notifyShopper(NotifyShopperRequest request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - String jsonResult = notifyShopper.request(jsonRequest); - return NotifyShopperResult.fromJson(jsonResult); - } - - /** - * Issues a createPermit API call - * - * @param request CreatePermitRequest - * @return CreatePermitResult - * @throws IOException IOException - * @throws ApiException ApiException - */ - public CreatePermitResult createPermit(CreatePermitRequest request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - String jsonResult = createPermit.request(jsonRequest); - return CreatePermitResult.fromJson(jsonResult); - } - - /** - * Issues a disablePermit API call - * - * @param request DisablePermitRequest - * @return DisablePermitResult - * @throws IOException IOException - * @throws ApiException ApiException - */ - public DisablePermitResult disablePermit(DisablePermitRequest request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - String jsonResult = disablePermit.request(jsonRequest); - return DisablePermitResult.fromJson(jsonResult); - } -} diff --git a/src/main/java/com/adyen/service/RecurringApi.java b/src/main/java/com/adyen/service/RecurringApi.java new file mode 100644 index 000000000..bdea742c6 --- /dev/null +++ b/src/main/java/com/adyen/service/RecurringApi.java @@ -0,0 +1,208 @@ +/* + * Adyen Recurring API + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/online-payments/tokenization). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Recurring API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Recurring/v68/disable ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. + * + * The version of the OpenAPI document: 68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.recurring.CreatePermitRequest; +import com.adyen.model.recurring.CreatePermitResult; +import com.adyen.model.recurring.DisablePermitRequest; +import com.adyen.model.recurring.DisablePermitResult; +import com.adyen.model.recurring.DisableRequest; +import com.adyen.model.recurring.DisableResult; +import com.adyen.model.recurring.NotifyShopperRequest; +import com.adyen.model.recurring.NotifyShopperResult; +import com.adyen.model.recurring.RecurringDetailsRequest; +import com.adyen.model.recurring.RecurringDetailsResult; +import com.adyen.model.recurring.ScheduleAccountUpdaterRequest; +import com.adyen.model.recurring.ScheduleAccountUpdaterResult; +import com.adyen.model.recurring.ServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class RecurringApi extends Service { + private final String baseURL; + + public RecurringApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://pal-test.adyen.com/pal/servlet/Recurring/v68"); + } + + /** + * Create new permits linked to a recurring contract. + * + * @param createPermitRequest {@link CreatePermitRequest } (required) + * @return {@link CreatePermitResult } + * @throws ApiException if fails to make API call + */ + public CreatePermitResult createPermit(CreatePermitRequest createPermitRequest) throws ApiException, IOException { + return createPermit(createPermitRequest, null); + } + + /** + * Create new permits linked to a recurring contract. + * + * @param createPermitRequest {@link CreatePermitRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CreatePermitResult } + * @throws ApiException if fails to make API call + */ + public CreatePermitResult createPermit(CreatePermitRequest createPermitRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = createPermitRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/createPermit", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return CreatePermitResult.fromJson(jsonResult); + } + + /** + * Disable stored payment details + * + * @param disableRequest {@link DisableRequest } (required) + * @return {@link DisableResult } + * @throws ApiException if fails to make API call + */ + public DisableResult disable(DisableRequest disableRequest) throws ApiException, IOException { + return disable(disableRequest, null); + } + + /** + * Disable stored payment details + * + * @param disableRequest {@link DisableRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link DisableResult } + * @throws ApiException if fails to make API call + */ + public DisableResult disable(DisableRequest disableRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = disableRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/disable", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return DisableResult.fromJson(jsonResult); + } + + /** + * Disable an existing permit. + * + * @param disablePermitRequest {@link DisablePermitRequest } (required) + * @return {@link DisablePermitResult } + * @throws ApiException if fails to make API call + */ + public DisablePermitResult disablePermit(DisablePermitRequest disablePermitRequest) throws ApiException, IOException { + return disablePermit(disablePermitRequest, null); + } + + /** + * Disable an existing permit. + * + * @param disablePermitRequest {@link DisablePermitRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link DisablePermitResult } + * @throws ApiException if fails to make API call + */ + public DisablePermitResult disablePermit(DisablePermitRequest disablePermitRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = disablePermitRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/disablePermit", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return DisablePermitResult.fromJson(jsonResult); + } + + /** + * Get stored payment details + * + * @param recurringDetailsRequest {@link RecurringDetailsRequest } (required) + * @return {@link RecurringDetailsResult } + * @throws ApiException if fails to make API call + */ + public RecurringDetailsResult listRecurringDetails(RecurringDetailsRequest recurringDetailsRequest) throws ApiException, IOException { + return listRecurringDetails(recurringDetailsRequest, null); + } + + /** + * Get stored payment details + * + * @param recurringDetailsRequest {@link RecurringDetailsRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link RecurringDetailsResult } + * @throws ApiException if fails to make API call + */ + public RecurringDetailsResult listRecurringDetails(RecurringDetailsRequest recurringDetailsRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = recurringDetailsRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/listRecurringDetails", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return RecurringDetailsResult.fromJson(jsonResult); + } + + /** + * Ask issuer to notify the shopper + * + * @param notifyShopperRequest {@link NotifyShopperRequest } (required) + * @return {@link NotifyShopperResult } + * @throws ApiException if fails to make API call + */ + public NotifyShopperResult notifyShopper(NotifyShopperRequest notifyShopperRequest) throws ApiException, IOException { + return notifyShopper(notifyShopperRequest, null); + } + + /** + * Ask issuer to notify the shopper + * + * @param notifyShopperRequest {@link NotifyShopperRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link NotifyShopperResult } + * @throws ApiException if fails to make API call + */ + public NotifyShopperResult notifyShopper(NotifyShopperRequest notifyShopperRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = notifyShopperRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/notifyShopper", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return NotifyShopperResult.fromJson(jsonResult); + } + + /** + * Schedule running the Account Updater + * + * @param scheduleAccountUpdaterRequest {@link ScheduleAccountUpdaterRequest } (required) + * @return {@link ScheduleAccountUpdaterResult } + * @throws ApiException if fails to make API call + */ + public ScheduleAccountUpdaterResult scheduleAccountUpdater(ScheduleAccountUpdaterRequest scheduleAccountUpdaterRequest) throws ApiException, IOException { + return scheduleAccountUpdater(scheduleAccountUpdaterRequest, null); + } + + /** + * Schedule running the Account Updater + * + * @param scheduleAccountUpdaterRequest {@link ScheduleAccountUpdaterRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ScheduleAccountUpdaterResult } + * @throws ApiException if fails to make API call + */ + public ScheduleAccountUpdaterResult scheduleAccountUpdater(ScheduleAccountUpdaterRequest scheduleAccountUpdaterRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = scheduleAccountUpdaterRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/scheduleAccountUpdater", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return ScheduleAccountUpdaterResult.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/AccountCompanyLevel.java b/src/main/java/com/adyen/service/management/AccountCompanyLevel.java deleted file mode 100644 index 6d2f4cc78..000000000 --- a/src/main/java/com/adyen/service/management/AccountCompanyLevel.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.Company; -import com.adyen.model.management.ListCompanyResponse; -import com.adyen.model.management.ListMerchantResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class AccountCompanyLevel extends ApiKeyAuthenticatedService { - public AccountCompanyLevel(Client client) { - super(client); - } - - /** - * Get a list of company accounts - * - * @param queryParams (optional) - * pageNumber: The number of the page to fetch. (optional) - * pageSize: The number of items to have on a page, maximum 100. The default is 10 items on a page. (optional) - * @return ListCompanyResponse - * @throws ApiException if fails to make API call - */ - public ListCompanyResponse listCompanyAccounts(Map queryParams) throws ApiException, IOException { - - Map pathParams = new HashMap<>(); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return ListCompanyResponse.fromJson(jsonResult); - } - - /** - * Get a company account - * - * @param companyId The unique identifier of the company account. (required) - * @return Company - * @throws ApiException if fails to make API call - */ - public Company getCompanyAccount(String companyId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return Company.fromJson(jsonResult); - } - - /** - * Get a list of merchant accounts - * - * @param companyId The unique identifier of the company account. (required) - * @param queryParams (optional) - * pageNumber: The number of the page to fetch. (optional) - * pageSize: The number of items to have on a page, maximum 100. The default is 10 items on a page. (optional) - * @return ListMerchantResponse - * @throws ApiException if fails to make API call - */ - public ListMerchantResponse listMerchantAccounts(String companyId, Map queryParams) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/merchants"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return ListMerchantResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/AccountCompanyLevelApi.java b/src/main/java/com/adyen/service/management/AccountCompanyLevelApi.java new file mode 100644 index 000000000..86c658d01 --- /dev/null +++ b/src/main/java/com/adyen/service/management/AccountCompanyLevelApi.java @@ -0,0 +1,147 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.Company; +import com.adyen.model.management.ListCompanyResponse; +import com.adyen.model.management.ListMerchantResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class AccountCompanyLevelApi extends Service { + private final String baseURL; + + public AccountCompanyLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of company accounts + * + * @return {@link ListCompanyResponse } + * @throws ApiException if fails to make API call + */ + public ListCompanyResponse listCompanyAccounts() throws ApiException, IOException { + return listCompanyAccounts(null, null, null); + } + + /** + * Get a list of company accounts + * + * @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) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ListCompanyResponse } + * @throws ApiException if fails to make API call + */ + public ListCompanyResponse listCompanyAccounts(Integer pageNumber, Integer pageSize, RequestOptions requestOptions) throws ApiException, IOException { + //Add query params + Map queryParams = new HashMap<>(); + 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", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, null, queryParams); + return ListCompanyResponse.fromJson(jsonResult); + } + + /** + * Get a company account + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @return {@link Company } + * @throws ApiException if fails to make API call + */ + public Company getCompanyAccount(String companyId) throws ApiException, IOException { + return getCompanyAccount(companyId, null); + } + + /** + * Get a company account + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Company } + * @throws ApiException if fails to make API call + */ + public Company getCompanyAccount(String companyId, 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 = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return Company.fromJson(jsonResult); + } + + /** + * Get a list of merchant accounts + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @return {@link ListMerchantResponse } + * @throws ApiException if fails to make API call + */ + public ListMerchantResponse listMerchantAccounts(String companyId) throws ApiException, IOException { + return listMerchantAccounts(companyId, null, null, null); + } + + /** + * Get a list of merchant accounts + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @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) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ListMerchantResponse } + * @throws ApiException if fails to make API call + */ + public ListMerchantResponse listMerchantAccounts(String companyId, 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); + //Add query params + Map queryParams = new HashMap<>(); + 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}/merchants", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return ListMerchantResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/AccountMerchantLevel.java b/src/main/java/com/adyen/service/management/AccountMerchantLevel.java deleted file mode 100644 index bf7c41c28..000000000 --- a/src/main/java/com/adyen/service/management/AccountMerchantLevel.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.CreateMerchantRequest; -import com.adyen.model.management.CreateMerchantResponse; -import com.adyen.model.management.ListMerchantResponse; -import com.adyen.model.management.Merchant; -import com.adyen.model.management.RequestActivationResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class AccountMerchantLevel extends ApiKeyAuthenticatedService { - public AccountMerchantLevel(Client client) { - super(client); - } - - /** - * Get a list of merchant accounts - * - * @param queryParams (optional) - * pageNumber: The number of the page to fetch. (optional) - * pageSize: The number of items to have on a page, maximum 100. The default is 10 items on a page. (optional) - * @return ListMerchantResponse - * @throws ApiException if fails to make API call - */ - public ListMerchantResponse listMerchantAccounts(Map queryParams) throws ApiException, IOException { - - Map pathParams = new HashMap<>(); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return ListMerchantResponse.fromJson(jsonResult); - } - - /** - * Get a merchant account - * - * @param merchantId The unique identifier of the merchant account. (required) - * @return Merchant - * @throws ApiException if fails to make API call - */ - public Merchant getMerchantAccount(String merchantId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return Merchant.fromJson(jsonResult); - } - - /** - * Create a merchant account - * - * @param createMerchantRequest (optional) - * @return CreateMerchantResponse - * @throws ApiException if fails to make API call - */ - public CreateMerchantResponse createMerchantAccount(CreateMerchantRequest createMerchantRequest) throws ApiException, IOException { - - Map pathParams = new HashMap<>(); - - String requestBody = createMerchantRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return CreateMerchantResponse.fromJson(jsonResult); - } - - /** - * Request to activate a merchant account - * - * @param merchantId The unique identifier of the merchant account. (required) - * @return RequestActivationResponse - * @throws ApiException if fails to make API call - */ - public RequestActivationResponse requestToActivateMerchantAccount(String merchantId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/activate"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return RequestActivationResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/AccountMerchantLevelApi.java b/src/main/java/com/adyen/service/management/AccountMerchantLevelApi.java new file mode 100644 index 000000000..eb60e416a --- /dev/null +++ b/src/main/java/com/adyen/service/management/AccountMerchantLevelApi.java @@ -0,0 +1,166 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.CreateMerchantRequest; +import com.adyen.model.management.CreateMerchantResponse; +import com.adyen.model.management.ListMerchantResponse; +import com.adyen.model.management.Merchant; +import com.adyen.model.management.RequestActivationResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class AccountMerchantLevelApi extends Service { + private final String baseURL; + + public AccountMerchantLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of merchant accounts + * + * @return {@link ListMerchantResponse } + * @throws ApiException if fails to make API call + */ + public ListMerchantResponse listMerchantAccounts() throws ApiException, IOException { + return listMerchantAccounts(null, null, null); + } + + /** + * Get a list of merchant accounts + * + * @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) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ListMerchantResponse } + * @throws ApiException if fails to make API call + */ + public ListMerchantResponse listMerchantAccounts(Integer pageNumber, Integer pageSize, RequestOptions requestOptions) throws ApiException, IOException { + //Add query params + Map queryParams = new HashMap<>(); + 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 + "/merchants", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, null, queryParams); + return ListMerchantResponse.fromJson(jsonResult); + } + + /** + * Get a merchant account + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @return {@link Merchant } + * @throws ApiException if fails to make API call + */ + public Merchant getMerchantAccount(String merchantId) throws ApiException, IOException { + return getMerchantAccount(merchantId, null); + } + + /** + * Get a merchant account + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Merchant } + * @throws ApiException if fails to make API call + */ + public Merchant getMerchantAccount(String merchantId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return Merchant.fromJson(jsonResult); + } + + /** + * Create a merchant account + * + * @param createMerchantRequest {@link CreateMerchantRequest } (required) + * @return {@link CreateMerchantResponse } + * @throws ApiException if fails to make API call + */ + public CreateMerchantResponse createMerchantAccount(CreateMerchantRequest createMerchantRequest) throws ApiException, IOException { + return createMerchantAccount(createMerchantRequest, null); + } + + /** + * Create a merchant account + * + * @param createMerchantRequest {@link CreateMerchantRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CreateMerchantResponse } + * @throws ApiException if fails to make API call + */ + public CreateMerchantResponse createMerchantAccount(CreateMerchantRequest createMerchantRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = createMerchantRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return CreateMerchantResponse.fromJson(jsonResult); + } + + /** + * Request to activate a merchant account + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @return {@link RequestActivationResponse } + * @throws ApiException if fails to make API call + */ + public RequestActivationResponse requestToActivateMerchantAccount(String merchantId) throws ApiException, IOException { + return requestToActivateMerchantAccount(merchantId, null); + } + + /** + * Request to activate a merchant account + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link RequestActivationResponse } + * @throws ApiException if fails to make API call + */ + public RequestActivationResponse requestToActivateMerchantAccount(String merchantId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/activate", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return RequestActivationResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/AccountStoreLevel.java b/src/main/java/com/adyen/service/management/AccountStoreLevel.java deleted file mode 100644 index 2eb187cc8..000000000 --- a/src/main/java/com/adyen/service/management/AccountStoreLevel.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.ListStoresResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.Store; -import com.adyen.model.management.StoreCreationRequest; -import com.adyen.model.management.StoreCreationWithMerchantCodeRequest; -import com.adyen.model.management.UpdateStoreRequest; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class AccountStoreLevel extends ApiKeyAuthenticatedService { - public AccountStoreLevel(Client client) { - super(client); - } - - /** - * Get a list of stores - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param queryParams (optional) - * pageNumber: The number of the page to fetch. (optional) - * pageSize: The number of items to have on a page, maximum 100. The default is 10 items on a page. (optional) - * reference: The reference of the store. (optional) - * @return ListStoresResponse - * @throws ApiException if fails to make API call - */ - public ListStoresResponse listStores(String merchantId, Map queryParams) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/stores"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return ListStoresResponse.fromJson(jsonResult); - } - - /** - * Get a store - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param storeId The unique identifier of the store. (required) - * @return Store - * @throws ApiException if fails to make API call - */ - public Store getStore(String merchantId, String storeId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (storeId == null) { - throw new ApiException("Missing the required parameter 'storeId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("storeId", storeId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/stores/{storeId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return Store.fromJson(jsonResult); - } - - /** - * Get a list of stores - * - * @param queryParams (optional) - * pageNumber: The number of the page to fetch. (optional) - * pageSize: The number of items to have on a page, maximum 100. The default is 10 items on a page. (optional) - * reference: The reference of the store. (optional) - * merchantId: The unique identifier of the merchant account. (optional) - * @return ListStoresResponse - * @throws ApiException if fails to make API call - */ - public ListStoresResponse listStores(Map queryParams) throws ApiException, IOException { - - Map pathParams = new HashMap<>(); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/stores"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return ListStoresResponse.fromJson(jsonResult); - } - - /** - * Get a store - * - * @param storeId The unique identifier of the store. (required) - * @return Store - * @throws ApiException if fails to make API call - */ - public Store getStore(String storeId) throws ApiException, IOException { - if (storeId == null) { - throw new ApiException("Missing the required parameter 'storeId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("storeId", storeId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/stores/{storeId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return Store.fromJson(jsonResult); - } - - /** - * Update a store - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param storeId The unique identifier of the store. (required) - * @param updateStoreRequest (optional) - * @return Store - * @throws ApiException if fails to make API call - */ - public Store updateStore(String merchantId, String storeId, UpdateStoreRequest updateStoreRequest) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (storeId == null) { - throw new ApiException("Missing the required parameter 'storeId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("storeId", storeId); - - String requestBody = updateStoreRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/stores/{storeId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return Store.fromJson(jsonResult); - } - - /** - * Update a store - * - * @param storeId The unique identifier of the store. (required) - * @param updateStoreRequest (optional) - * @return Store - * @throws ApiException if fails to make API call - */ - public Store updateStore(String storeId, UpdateStoreRequest updateStoreRequest) throws ApiException, IOException { - if (storeId == null) { - throw new ApiException("Missing the required parameter 'storeId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("storeId", storeId); - - String requestBody = updateStoreRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/stores/{storeId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return Store.fromJson(jsonResult); - } - - /** - * Create a store - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param storeCreationRequest (optional) - * @return Store - * @throws ApiException if fails to make API call - */ - public Store createStore(String merchantId, StoreCreationRequest storeCreationRequest) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = storeCreationRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/stores"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return Store.fromJson(jsonResult); - } - - /** - * Create a store - * - * @param storeCreationWithMerchantCodeRequest (optional) - * @return Store - * @throws ApiException if fails to make API call - */ - public Store createStore(StoreCreationWithMerchantCodeRequest storeCreationWithMerchantCodeRequest) throws ApiException, IOException { - - Map pathParams = new HashMap<>(); - - String requestBody = storeCreationWithMerchantCodeRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/stores"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return Store.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/AccountStoreLevelApi.java b/src/main/java/com/adyen/service/management/AccountStoreLevelApi.java new file mode 100644 index 000000000..fabe4aade --- /dev/null +++ b/src/main/java/com/adyen/service/management/AccountStoreLevelApi.java @@ -0,0 +1,338 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.ListStoresResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.Store; +import com.adyen.model.management.StoreCreationRequest; +import com.adyen.model.management.StoreCreationWithMerchantCodeRequest; +import com.adyen.model.management.UpdateStoreRequest; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class AccountStoreLevelApi extends Service { + private final String baseURL; + + public AccountStoreLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of stores + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @return {@link ListStoresResponse } + * @throws ApiException if fails to make API call + */ + public ListStoresResponse listStoresByMerchantId(String merchantId) throws ApiException, IOException { + return listStoresByMerchantId(merchantId, null, null, null, null); + } + + /** + * Get a list of stores + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @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) + * @param reference {@link String } Query: The reference of the store. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ListStoresResponse } + * @throws ApiException if fails to make API call + */ + public ListStoresResponse listStoresByMerchantId(String merchantId, Integer pageNumber, Integer pageSize, String reference, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + //Add query params + Map queryParams = new HashMap<>(); + if (pageNumber != null) { + queryParams.put("pageNumber", pageNumber.toString()); + } + if (pageSize != null) { + queryParams.put("pageSize", pageSize.toString()); + } + if (reference != null) { + queryParams.put("reference", reference); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/stores", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return ListStoresResponse.fromJson(jsonResult); + } + + /** + * Get a store + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param storeId {@link String } The unique identifier of the store. (required) + * @return {@link Store } + * @throws ApiException if fails to make API call + */ + public Store getStore(String merchantId, String storeId) throws ApiException, IOException { + return getStore(merchantId, storeId, null); + } + + /** + * Get a store + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param storeId {@link String } The unique identifier of the store. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Store } + * @throws ApiException if fails to make API call + */ + public Store getStore(String merchantId, String storeId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (storeId == null) { + throw new IllegalArgumentException("Please provide the storeId path parameter"); + } + pathParams.put("storeId", storeId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/stores/{storeId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return Store.fromJson(jsonResult); + } + + /** + * Get a list of stores + * + * @return {@link ListStoresResponse } + * @throws ApiException if fails to make API call + */ + public ListStoresResponse listStores() throws ApiException, IOException { + return listStores(null, null, null, null, null); + } + + /** + * Get a list of stores + * + * @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) + * @param reference {@link String } Query: The reference of the store. (optional) + * @param merchantId {@link String } Query: The unique identifier of the merchant account. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ListStoresResponse } + * @throws ApiException if fails to make API call + */ + public ListStoresResponse listStores(Integer pageNumber, Integer pageSize, String reference, String merchantId, RequestOptions requestOptions) throws ApiException, IOException { + //Add query params + Map queryParams = new HashMap<>(); + if (pageNumber != null) { + queryParams.put("pageNumber", pageNumber.toString()); + } + if (pageSize != null) { + queryParams.put("pageSize", pageSize.toString()); + } + if (reference != null) { + queryParams.put("reference", reference); + } + if (merchantId != null) { + queryParams.put("merchantId", merchantId); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/stores", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, null, queryParams); + return ListStoresResponse.fromJson(jsonResult); + } + + /** + * Get a store + * + * @param storeId {@link String } The unique identifier of the store. (required) + * @return {@link Store } + * @throws ApiException if fails to make API call + */ + public Store getStoreById(String storeId) throws ApiException, IOException { + return getStoreById(storeId, null); + } + + /** + * Get a store + * + * @param storeId {@link String } The unique identifier of the store. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Store } + * @throws ApiException if fails to make API call + */ + public Store getStoreById(String storeId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (storeId == null) { + throw new IllegalArgumentException("Please provide the storeId path parameter"); + } + pathParams.put("storeId", storeId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/stores/{storeId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return Store.fromJson(jsonResult); + } + + /** + * Update a store + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param storeId {@link String } The unique identifier of the store. (required) + * @param updateStoreRequest {@link UpdateStoreRequest } (required) + * @return {@link Store } + * @throws ApiException if fails to make API call + */ + public Store updateStore(String merchantId, String storeId, UpdateStoreRequest updateStoreRequest) throws ApiException, IOException { + return updateStore(merchantId, storeId, updateStoreRequest, null); + } + + /** + * Update a store + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param storeId {@link String } The unique identifier of the store. (required) + * @param updateStoreRequest {@link UpdateStoreRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Store } + * @throws ApiException if fails to make API call + */ + public Store updateStore(String merchantId, String storeId, UpdateStoreRequest updateStoreRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (storeId == null) { + throw new IllegalArgumentException("Please provide the storeId path parameter"); + } + pathParams.put("storeId", storeId); + + String requestBody = updateStoreRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/stores/{storeId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return Store.fromJson(jsonResult); + } + + /** + * Update a store + * + * @param storeId {@link String } The unique identifier of the store. (required) + * @param updateStoreRequest {@link UpdateStoreRequest } (required) + * @return {@link Store } + * @throws ApiException if fails to make API call + */ + public Store updateStoreById(String storeId, UpdateStoreRequest updateStoreRequest) throws ApiException, IOException { + return updateStoreById(storeId, updateStoreRequest, null); + } + + /** + * Update a store + * + * @param storeId {@link String } The unique identifier of the store. (required) + * @param updateStoreRequest {@link UpdateStoreRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Store } + * @throws ApiException if fails to make API call + */ + public Store updateStoreById(String storeId, UpdateStoreRequest updateStoreRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (storeId == null) { + throw new IllegalArgumentException("Please provide the storeId path parameter"); + } + pathParams.put("storeId", storeId); + + String requestBody = updateStoreRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/stores/{storeId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return Store.fromJson(jsonResult); + } + + /** + * Create a store + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param storeCreationRequest {@link StoreCreationRequest } (required) + * @return {@link Store } + * @throws ApiException if fails to make API call + */ + public Store createStoreByMerchantId(String merchantId, StoreCreationRequest storeCreationRequest) throws ApiException, IOException { + return createStoreByMerchantId(merchantId, storeCreationRequest, null); + } + + /** + * Create a store + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param storeCreationRequest {@link StoreCreationRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Store } + * @throws ApiException if fails to make API call + */ + public Store createStoreByMerchantId(String merchantId, StoreCreationRequest storeCreationRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + + String requestBody = storeCreationRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/stores", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return Store.fromJson(jsonResult); + } + + /** + * Create a store + * + * @param storeCreationWithMerchantCodeRequest {@link StoreCreationWithMerchantCodeRequest } (required) + * @return {@link Store } + * @throws ApiException if fails to make API call + */ + public Store createStore(StoreCreationWithMerchantCodeRequest storeCreationWithMerchantCodeRequest) throws ApiException, IOException { + return createStore(storeCreationWithMerchantCodeRequest, null); + } + + /** + * Create a store + * + * @param storeCreationWithMerchantCodeRequest {@link StoreCreationWithMerchantCodeRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Store } + * @throws ApiException if fails to make API call + */ + public Store createStore(StoreCreationWithMerchantCodeRequest storeCreationWithMerchantCodeRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = storeCreationWithMerchantCodeRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/stores", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return Store.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevel.java b/src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevel.java deleted file mode 100644 index 7fbb6a110..000000000 --- a/src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevel.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.AllowedOrigin; -import com.adyen.model.management.AllowedOriginsResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class AllowedOriginsCompanyLevel extends ApiKeyAuthenticatedService { - public AllowedOriginsCompanyLevel(Client client) { - super(client); - } - - /** - * Delete an allowed origin - * - * @param companyId The unique identifier of the company account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @param originId Unique identifier of the allowed origin. (required) - * @throws ApiException if fails to make API call - */ - public void deleteAllowedOrigin(String companyId, String apiCredentialId, String originId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - if (originId == null) { - throw new ApiException("Missing the required parameter 'originId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("apiCredentialId", apiCredentialId); - pathParams.put("originId", originId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"); - resource.request(requestBody, null, ApiConstants.HttpMethod.DELETE, pathParams); - } - - /** - * Get a list of allowed origins - * - * @param companyId The unique identifier of the company account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @return AllowedOriginsResponse - * @throws ApiException if fails to make API call - */ - public AllowedOriginsResponse listAllowedOrigins(String companyId, String apiCredentialId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("apiCredentialId", apiCredentialId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return AllowedOriginsResponse.fromJson(jsonResult); - } - - /** - * Get an allowed origin - * - * @param companyId The unique identifier of the company account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @param originId Unique identifier of the allowed origin. (required) - * @return AllowedOrigin - * @throws ApiException if fails to make API call - */ - public AllowedOrigin getAllowedOrigin(String companyId, String apiCredentialId, String originId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - if (originId == null) { - throw new ApiException("Missing the required parameter 'originId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("apiCredentialId", apiCredentialId); - pathParams.put("originId", originId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return AllowedOrigin.fromJson(jsonResult); - } - - /** - * Create an allowed origin - * - * @param companyId The unique identifier of the company account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @param allowedOrigin (optional) - * @return AllowedOriginsResponse - * @throws ApiException if fails to make API call - */ - public AllowedOriginsResponse createAllowedOrigin(String companyId, String apiCredentialId, AllowedOrigin allowedOrigin) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("apiCredentialId", apiCredentialId); - - String requestBody = allowedOrigin.toJson(); - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return AllowedOriginsResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevelApi.java b/src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevelApi.java new file mode 100644 index 000000000..9e9f77e93 --- /dev/null +++ b/src/main/java/com/adyen/service/management/AllowedOriginsCompanyLevelApi.java @@ -0,0 +1,202 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.AllowedOrigin; +import com.adyen.model.management.AllowedOriginsResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class AllowedOriginsCompanyLevelApi extends Service { + private final String baseURL; + + public AllowedOriginsCompanyLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Delete an allowed origin + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param originId {@link String } Unique identifier of the allowed origin. (required) + * @throws ApiException if fails to make API call + */ + public void deleteAllowedOrigin(String companyId, String apiCredentialId, String originId) throws ApiException, IOException { + deleteAllowedOrigin(companyId, apiCredentialId, originId, null); + } + + /** + * Delete an allowed origin + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param originId {@link String } Unique identifier of the allowed origin. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @throws ApiException if fails to make API call + */ + public void deleteAllowedOrigin(String companyId, String apiCredentialId, String originId, 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 (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + if (originId == null) { + throw new IllegalArgumentException("Please provide the originId path parameter"); + } + pathParams.put("originId", originId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}", null); + resource.request(requestBody, null, ApiConstants.HttpMethod.DELETE, pathParams); + } + + /** + * Get a list of allowed origins + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @return {@link AllowedOriginsResponse } + * @throws ApiException if fails to make API call + */ + public AllowedOriginsResponse listAllowedOrigins(String companyId, String apiCredentialId) throws ApiException, IOException { + return listAllowedOrigins(companyId, apiCredentialId, null); + } + + /** + * Get a list of allowed origins + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AllowedOriginsResponse } + * @throws ApiException if fails to make API call + */ + public AllowedOriginsResponse listAllowedOrigins(String companyId, String apiCredentialId, 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 (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return AllowedOriginsResponse.fromJson(jsonResult); + } + + /** + * Get an allowed origin + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param originId {@link String } Unique identifier of the allowed origin. (required) + * @return {@link AllowedOrigin } + * @throws ApiException if fails to make API call + */ + public AllowedOrigin getAllowedOrigin(String companyId, String apiCredentialId, String originId) throws ApiException, IOException { + return getAllowedOrigin(companyId, apiCredentialId, originId, null); + } + + /** + * Get an allowed origin + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param originId {@link String } Unique identifier of the allowed origin. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AllowedOrigin } + * @throws ApiException if fails to make API call + */ + public AllowedOrigin getAllowedOrigin(String companyId, String apiCredentialId, String originId, 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 (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + if (originId == null) { + throw new IllegalArgumentException("Please provide the originId path parameter"); + } + pathParams.put("originId", originId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return AllowedOrigin.fromJson(jsonResult); + } + + /** + * Create an allowed origin + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param allowedOrigin {@link AllowedOrigin } (required) + * @return {@link AllowedOriginsResponse } + * @throws ApiException if fails to make API call + */ + public AllowedOriginsResponse createAllowedOrigin(String companyId, String apiCredentialId, AllowedOrigin allowedOrigin) throws ApiException, IOException { + return createAllowedOrigin(companyId, apiCredentialId, allowedOrigin, null); + } + + /** + * Create an allowed origin + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param allowedOrigin {@link AllowedOrigin } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AllowedOriginsResponse } + * @throws ApiException if fails to make API call + */ + public AllowedOriginsResponse createAllowedOrigin(String companyId, String apiCredentialId, AllowedOrigin allowedOrigin, 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 (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + + String requestBody = allowedOrigin.toJson(); + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return AllowedOriginsResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevel.java b/src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevel.java deleted file mode 100644 index 56c8638b2..000000000 --- a/src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevel.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.AllowedOrigin; -import com.adyen.model.management.AllowedOriginsResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class AllowedOriginsMerchantLevel extends ApiKeyAuthenticatedService { - public AllowedOriginsMerchantLevel(Client client) { - super(client); - } - - /** - * Delete an allowed origin - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @param originId Unique identifier of the allowed origin. (required) - * @throws ApiException if fails to make API call - */ - public void deleteAllowedOrigin(String merchantId, String apiCredentialId, String originId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - if (originId == null) { - throw new ApiException("Missing the required parameter 'originId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("apiCredentialId", apiCredentialId); - pathParams.put("originId", originId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"); - resource.request(requestBody, null, ApiConstants.HttpMethod.DELETE, pathParams); - } - - /** - * Get a list of allowed origins - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @return AllowedOriginsResponse - * @throws ApiException if fails to make API call - */ - public AllowedOriginsResponse listAllowedOrigins(String merchantId, String apiCredentialId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("apiCredentialId", apiCredentialId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return AllowedOriginsResponse.fromJson(jsonResult); - } - - /** - * Get an allowed origin - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @param originId Unique identifier of the allowed origin. (required) - * @return AllowedOrigin - * @throws ApiException if fails to make API call - */ - public AllowedOrigin getAllowedOrigin(String merchantId, String apiCredentialId, String originId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - if (originId == null) { - throw new ApiException("Missing the required parameter 'originId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("apiCredentialId", apiCredentialId); - pathParams.put("originId", originId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return AllowedOrigin.fromJson(jsonResult); - } - - /** - * Create an allowed origin - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @param allowedOrigin (optional) - * @return AllowedOriginsResponse - * @throws ApiException if fails to make API call - */ - public AllowedOriginsResponse createAllowedOrigin(String merchantId, String apiCredentialId, AllowedOrigin allowedOrigin) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("apiCredentialId", apiCredentialId); - - String requestBody = allowedOrigin.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return AllowedOriginsResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevelApi.java b/src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevelApi.java new file mode 100644 index 000000000..02481cbf1 --- /dev/null +++ b/src/main/java/com/adyen/service/management/AllowedOriginsMerchantLevelApi.java @@ -0,0 +1,202 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.AllowedOrigin; +import com.adyen.model.management.AllowedOriginsResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class AllowedOriginsMerchantLevelApi extends Service { + private final String baseURL; + + public AllowedOriginsMerchantLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Delete an allowed origin + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param originId {@link String } Unique identifier of the allowed origin. (required) + * @throws ApiException if fails to make API call + */ + public void deleteAllowedOrigin(String merchantId, String apiCredentialId, String originId) throws ApiException, IOException { + deleteAllowedOrigin(merchantId, apiCredentialId, originId, null); + } + + /** + * Delete an allowed origin + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param originId {@link String } Unique identifier of the allowed origin. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @throws ApiException if fails to make API call + */ + public void deleteAllowedOrigin(String merchantId, String apiCredentialId, String originId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + if (originId == null) { + throw new IllegalArgumentException("Please provide the originId path parameter"); + } + pathParams.put("originId", originId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}", null); + resource.request(requestBody, null, ApiConstants.HttpMethod.DELETE, pathParams); + } + + /** + * Get a list of allowed origins + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @return {@link AllowedOriginsResponse } + * @throws ApiException if fails to make API call + */ + public AllowedOriginsResponse listAllowedOrigins(String merchantId, String apiCredentialId) throws ApiException, IOException { + return listAllowedOrigins(merchantId, apiCredentialId, null); + } + + /** + * Get a list of allowed origins + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AllowedOriginsResponse } + * @throws ApiException if fails to make API call + */ + public AllowedOriginsResponse listAllowedOrigins(String merchantId, String apiCredentialId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return AllowedOriginsResponse.fromJson(jsonResult); + } + + /** + * Get an allowed origin + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param originId {@link String } Unique identifier of the allowed origin. (required) + * @return {@link AllowedOrigin } + * @throws ApiException if fails to make API call + */ + public AllowedOrigin getAllowedOrigin(String merchantId, String apiCredentialId, String originId) throws ApiException, IOException { + return getAllowedOrigin(merchantId, apiCredentialId, originId, null); + } + + /** + * Get an allowed origin + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param originId {@link String } Unique identifier of the allowed origin. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AllowedOrigin } + * @throws ApiException if fails to make API call + */ + public AllowedOrigin getAllowedOrigin(String merchantId, String apiCredentialId, String originId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + if (originId == null) { + throw new IllegalArgumentException("Please provide the originId path parameter"); + } + pathParams.put("originId", originId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return AllowedOrigin.fromJson(jsonResult); + } + + /** + * Create an allowed origin + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param allowedOrigin {@link AllowedOrigin } (required) + * @return {@link AllowedOriginsResponse } + * @throws ApiException if fails to make API call + */ + public AllowedOriginsResponse createAllowedOrigin(String merchantId, String apiCredentialId, AllowedOrigin allowedOrigin) throws ApiException, IOException { + return createAllowedOrigin(merchantId, apiCredentialId, allowedOrigin, null); + } + + /** + * Create an allowed origin + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param allowedOrigin {@link AllowedOrigin } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AllowedOriginsResponse } + * @throws ApiException if fails to make API call + */ + public AllowedOriginsResponse createAllowedOrigin(String merchantId, String apiCredentialId, AllowedOrigin allowedOrigin, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + + String requestBody = allowedOrigin.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return AllowedOriginsResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevel.java b/src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevel.java deleted file mode 100644 index f377da575..000000000 --- a/src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevel.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.CompanyApiCredential; -import com.adyen.model.management.CreateCompanyApiCredentialRequest; -import com.adyen.model.management.CreateCompanyApiCredentialResponse; -import com.adyen.model.management.ListCompanyApiCredentialsResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.UpdateCompanyApiCredentialRequest; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class ApiCredentialsCompanyLevel extends ApiKeyAuthenticatedService { - public ApiCredentialsCompanyLevel(Client client) { - super(client); - } - - /** - * Get a list of API credentials - * - * @param companyId The unique identifier of the company account. (required) - * @param queryParams (optional) - * pageNumber: The number of the page to fetch. (optional) - * pageSize: The number of items to have on a page, maximum 100. The default is 10 items on a page. (optional) - * @return ListCompanyApiCredentialsResponse - * @throws ApiException if fails to make API call - */ - public ListCompanyApiCredentialsResponse listApiCredentials(String companyId, Map queryParams) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/apiCredentials"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return ListCompanyApiCredentialsResponse.fromJson(jsonResult); - } - - /** - * Get an API credential - * - * @param companyId The unique identifier of the company account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @return CompanyApiCredential - * @throws ApiException if fails to make API call - */ - public CompanyApiCredential getApiCredential(String companyId, String apiCredentialId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("apiCredentialId", apiCredentialId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/apiCredentials/{apiCredentialId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return CompanyApiCredential.fromJson(jsonResult); - } - - /** - * Update an API credential. - * - * @param companyId The unique identifier of the company account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @param updateCompanyApiCredentialRequest (optional) - * @return CompanyApiCredential - * @throws ApiException if fails to make API call - */ - public CompanyApiCredential updateApiCredential(String companyId, String apiCredentialId, UpdateCompanyApiCredentialRequest updateCompanyApiCredentialRequest) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("apiCredentialId", apiCredentialId); - - String requestBody = updateCompanyApiCredentialRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/apiCredentials/{apiCredentialId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return CompanyApiCredential.fromJson(jsonResult); - } - - /** - * Create an API credential. - * - * @param companyId The unique identifier of the company account. (required) - * @param createCompanyApiCredentialRequest (optional) - * @return CreateCompanyApiCredentialResponse - * @throws ApiException if fails to make API call - */ - public CreateCompanyApiCredentialResponse createApiCredential(String companyId, CreateCompanyApiCredentialRequest createCompanyApiCredentialRequest) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = createCompanyApiCredentialRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/apiCredentials"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return CreateCompanyApiCredentialResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevelApi.java b/src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevelApi.java new file mode 100644 index 000000000..d6449b117 --- /dev/null +++ b/src/main/java/com/adyen/service/management/ApiCredentialsCompanyLevelApi.java @@ -0,0 +1,196 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.CompanyApiCredential; +import com.adyen.model.management.CreateCompanyApiCredentialRequest; +import com.adyen.model.management.CreateCompanyApiCredentialResponse; +import com.adyen.model.management.ListCompanyApiCredentialsResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.UpdateCompanyApiCredentialRequest; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class ApiCredentialsCompanyLevelApi extends Service { + private final String baseURL; + + public ApiCredentialsCompanyLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of API credentials + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @return {@link ListCompanyApiCredentialsResponse } + * @throws ApiException if fails to make API call + */ + public ListCompanyApiCredentialsResponse listApiCredentials(String companyId) throws ApiException, IOException { + return listApiCredentials(companyId, null, null, null); + } + + /** + * Get a list of API credentials + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @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) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ListCompanyApiCredentialsResponse } + * @throws ApiException if fails to make API call + */ + public ListCompanyApiCredentialsResponse listApiCredentials(String companyId, 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); + //Add query params + Map queryParams = new HashMap<>(); + 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}/apiCredentials", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return ListCompanyApiCredentialsResponse.fromJson(jsonResult); + } + + /** + * Get an API credential + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @return {@link CompanyApiCredential } + * @throws ApiException if fails to make API call + */ + public CompanyApiCredential getApiCredential(String companyId, String apiCredentialId) throws ApiException, IOException { + return getApiCredential(companyId, apiCredentialId, null); + } + + /** + * Get an API credential + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CompanyApiCredential } + * @throws ApiException if fails to make API call + */ + public CompanyApiCredential getApiCredential(String companyId, String apiCredentialId, 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 (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/apiCredentials/{apiCredentialId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return CompanyApiCredential.fromJson(jsonResult); + } + + /** + * Update an API credential. + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param updateCompanyApiCredentialRequest {@link UpdateCompanyApiCredentialRequest } (required) + * @return {@link CompanyApiCredential } + * @throws ApiException if fails to make API call + */ + public CompanyApiCredential updateApiCredential(String companyId, String apiCredentialId, UpdateCompanyApiCredentialRequest updateCompanyApiCredentialRequest) throws ApiException, IOException { + return updateApiCredential(companyId, apiCredentialId, updateCompanyApiCredentialRequest, null); + } + + /** + * Update an API credential. + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param updateCompanyApiCredentialRequest {@link UpdateCompanyApiCredentialRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CompanyApiCredential } + * @throws ApiException if fails to make API call + */ + public CompanyApiCredential updateApiCredential(String companyId, String apiCredentialId, UpdateCompanyApiCredentialRequest updateCompanyApiCredentialRequest, 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 (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + + String requestBody = updateCompanyApiCredentialRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/apiCredentials/{apiCredentialId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return CompanyApiCredential.fromJson(jsonResult); + } + + /** + * Create an API credential. + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param createCompanyApiCredentialRequest {@link CreateCompanyApiCredentialRequest } (required) + * @return {@link CreateCompanyApiCredentialResponse } + * @throws ApiException if fails to make API call + */ + public CreateCompanyApiCredentialResponse createApiCredential(String companyId, CreateCompanyApiCredentialRequest createCompanyApiCredentialRequest) throws ApiException, IOException { + return createApiCredential(companyId, createCompanyApiCredentialRequest, null); + } + + /** + * Create an API credential. + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param createCompanyApiCredentialRequest {@link CreateCompanyApiCredentialRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CreateCompanyApiCredentialResponse } + * @throws ApiException if fails to make API call + */ + public CreateCompanyApiCredentialResponse createApiCredential(String companyId, CreateCompanyApiCredentialRequest createCompanyApiCredentialRequest, 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 = createCompanyApiCredentialRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/apiCredentials", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return CreateCompanyApiCredentialResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevel.java b/src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevel.java deleted file mode 100644 index d1f69926a..000000000 --- a/src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevel.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.ApiCredential; -import com.adyen.model.management.CreateApiCredentialResponse; -import com.adyen.model.management.CreateMerchantApiCredentialRequest; -import com.adyen.model.management.ListMerchantApiCredentialsResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.UpdateMerchantApiCredentialRequest; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class ApiCredentialsMerchantLevel extends ApiKeyAuthenticatedService { - public ApiCredentialsMerchantLevel(Client client) { - super(client); - } - - /** - * Get a list of API credentials - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param queryParams (optional) - * pageNumber: The number of the page to fetch. (optional) - * pageSize: The number of items to have on a page, maximum 100. The default is 10 items on a page. (optional) - * @return ListMerchantApiCredentialsResponse - * @throws ApiException if fails to make API call - */ - public ListMerchantApiCredentialsResponse listApiCredentials(String merchantId, Map queryParams) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/apiCredentials"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return ListMerchantApiCredentialsResponse.fromJson(jsonResult); - } - - /** - * Get an API credential - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @return ApiCredential - * @throws ApiException if fails to make API call - */ - public ApiCredential getApiCredential(String merchantId, String apiCredentialId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("apiCredentialId", apiCredentialId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/apiCredentials/{apiCredentialId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return ApiCredential.fromJson(jsonResult); - } - - /** - * Update an API credential - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @param updateMerchantApiCredentialRequest (optional) - * @return ApiCredential - * @throws ApiException if fails to make API call - */ - public ApiCredential updateApiCredential(String merchantId, String apiCredentialId, UpdateMerchantApiCredentialRequest updateMerchantApiCredentialRequest) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("apiCredentialId", apiCredentialId); - - String requestBody = updateMerchantApiCredentialRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/apiCredentials/{apiCredentialId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return ApiCredential.fromJson(jsonResult); - } - - /** - * Create an API credential - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param createMerchantApiCredentialRequest (optional) - * @return CreateApiCredentialResponse - * @throws ApiException if fails to make API call - */ - public CreateApiCredentialResponse createApiCredential(String merchantId, CreateMerchantApiCredentialRequest createMerchantApiCredentialRequest) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = createMerchantApiCredentialRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/apiCredentials"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return CreateApiCredentialResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevelApi.java b/src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevelApi.java new file mode 100644 index 000000000..e24a5e2c5 --- /dev/null +++ b/src/main/java/com/adyen/service/management/ApiCredentialsMerchantLevelApi.java @@ -0,0 +1,196 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.ApiCredential; +import com.adyen.model.management.CreateApiCredentialResponse; +import com.adyen.model.management.CreateMerchantApiCredentialRequest; +import com.adyen.model.management.ListMerchantApiCredentialsResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.UpdateMerchantApiCredentialRequest; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class ApiCredentialsMerchantLevelApi extends Service { + private final String baseURL; + + public ApiCredentialsMerchantLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of API credentials + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @return {@link ListMerchantApiCredentialsResponse } + * @throws ApiException if fails to make API call + */ + public ListMerchantApiCredentialsResponse listApiCredentials(String merchantId) throws ApiException, IOException { + return listApiCredentials(merchantId, null, null, null); + } + + /** + * Get a list of API credentials + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @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) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ListMerchantApiCredentialsResponse } + * @throws ApiException if fails to make API call + */ + public ListMerchantApiCredentialsResponse listApiCredentials(String merchantId, Integer pageNumber, Integer pageSize, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + //Add query params + Map queryParams = new HashMap<>(); + 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 + "/merchants/{merchantId}/apiCredentials", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return ListMerchantApiCredentialsResponse.fromJson(jsonResult); + } + + /** + * Get an API credential + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @return {@link ApiCredential } + * @throws ApiException if fails to make API call + */ + public ApiCredential getApiCredential(String merchantId, String apiCredentialId) throws ApiException, IOException { + return getApiCredential(merchantId, apiCredentialId, null); + } + + /** + * Get an API credential + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ApiCredential } + * @throws ApiException if fails to make API call + */ + public ApiCredential getApiCredential(String merchantId, String apiCredentialId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/apiCredentials/{apiCredentialId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return ApiCredential.fromJson(jsonResult); + } + + /** + * Update an API credential + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param updateMerchantApiCredentialRequest {@link UpdateMerchantApiCredentialRequest } (required) + * @return {@link ApiCredential } + * @throws ApiException if fails to make API call + */ + public ApiCredential updateApiCredential(String merchantId, String apiCredentialId, UpdateMerchantApiCredentialRequest updateMerchantApiCredentialRequest) throws ApiException, IOException { + return updateApiCredential(merchantId, apiCredentialId, updateMerchantApiCredentialRequest, null); + } + + /** + * Update an API credential + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param updateMerchantApiCredentialRequest {@link UpdateMerchantApiCredentialRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ApiCredential } + * @throws ApiException if fails to make API call + */ + public ApiCredential updateApiCredential(String merchantId, String apiCredentialId, UpdateMerchantApiCredentialRequest updateMerchantApiCredentialRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + + String requestBody = updateMerchantApiCredentialRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/apiCredentials/{apiCredentialId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return ApiCredential.fromJson(jsonResult); + } + + /** + * Create an API credential + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param createMerchantApiCredentialRequest {@link CreateMerchantApiCredentialRequest } (required) + * @return {@link CreateApiCredentialResponse } + * @throws ApiException if fails to make API call + */ + public CreateApiCredentialResponse createApiCredential(String merchantId, CreateMerchantApiCredentialRequest createMerchantApiCredentialRequest) throws ApiException, IOException { + return createApiCredential(merchantId, createMerchantApiCredentialRequest, null); + } + + /** + * Create an API credential + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param createMerchantApiCredentialRequest {@link CreateMerchantApiCredentialRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CreateApiCredentialResponse } + * @throws ApiException if fails to make API call + */ + public CreateApiCredentialResponse createApiCredential(String merchantId, CreateMerchantApiCredentialRequest createMerchantApiCredentialRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + + String requestBody = createMerchantApiCredentialRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/apiCredentials", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return CreateApiCredentialResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/ApiKeyCompanyLevel.java b/src/main/java/com/adyen/service/management/ApiKeyCompanyLevel.java deleted file mode 100644 index f37c5198f..000000000 --- a/src/main/java/com/adyen/service/management/ApiKeyCompanyLevel.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.GenerateApiKeyResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class ApiKeyCompanyLevel extends ApiKeyAuthenticatedService { - public ApiKeyCompanyLevel(Client client) { - super(client); - } - - /** - * Generate new API key - * - * @param companyId The unique identifier of the company account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @return GenerateApiKeyResponse - * @throws ApiException if fails to make API call - */ - public GenerateApiKeyResponse generateNewApiKey(String companyId, String apiCredentialId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("apiCredentialId", apiCredentialId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/apiCredentials/{apiCredentialId}/generateApiKey"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return GenerateApiKeyResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/ApiKeyCompanyLevelApi.java b/src/main/java/com/adyen/service/management/ApiKeyCompanyLevelApi.java new file mode 100644 index 000000000..666862e3b --- /dev/null +++ b/src/main/java/com/adyen/service/management/ApiKeyCompanyLevelApi.java @@ -0,0 +1,73 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.GenerateApiKeyResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class ApiKeyCompanyLevelApi extends Service { + private final String baseURL; + + public ApiKeyCompanyLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Generate new API key + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @return {@link GenerateApiKeyResponse } + * @throws ApiException if fails to make API call + */ + public GenerateApiKeyResponse generateNewApiKey(String companyId, String apiCredentialId) throws ApiException, IOException { + return generateNewApiKey(companyId, apiCredentialId, null); + } + + /** + * Generate new API key + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GenerateApiKeyResponse } + * @throws ApiException if fails to make API call + */ + public GenerateApiKeyResponse generateNewApiKey(String companyId, String apiCredentialId, 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 (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/apiCredentials/{apiCredentialId}/generateApiKey", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return GenerateApiKeyResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/ApiKeyMerchantLevel.java b/src/main/java/com/adyen/service/management/ApiKeyMerchantLevel.java deleted file mode 100644 index f4986a1ab..000000000 --- a/src/main/java/com/adyen/service/management/ApiKeyMerchantLevel.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.GenerateApiKeyResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class ApiKeyMerchantLevel extends ApiKeyAuthenticatedService { - public ApiKeyMerchantLevel(Client client) { - super(client); - } - - /** - * Generate new API key - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @return GenerateApiKeyResponse - * @throws ApiException if fails to make API call - */ - public GenerateApiKeyResponse generateNewApiKey(String merchantId, String apiCredentialId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("apiCredentialId", apiCredentialId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateApiKey"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return GenerateApiKeyResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/ApiKeyMerchantLevelApi.java b/src/main/java/com/adyen/service/management/ApiKeyMerchantLevelApi.java new file mode 100644 index 000000000..1c20206dc --- /dev/null +++ b/src/main/java/com/adyen/service/management/ApiKeyMerchantLevelApi.java @@ -0,0 +1,73 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.GenerateApiKeyResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class ApiKeyMerchantLevelApi extends Service { + private final String baseURL; + + public ApiKeyMerchantLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Generate new API key + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @return {@link GenerateApiKeyResponse } + * @throws ApiException if fails to make API call + */ + public GenerateApiKeyResponse generateNewApiKey(String merchantId, String apiCredentialId) throws ApiException, IOException { + return generateNewApiKey(merchantId, apiCredentialId, null); + } + + /** + * Generate new API key + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GenerateApiKeyResponse } + * @throws ApiException if fails to make API call + */ + public GenerateApiKeyResponse generateNewApiKey(String merchantId, String apiCredentialId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateApiKey", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return GenerateApiKeyResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/ClientKeyCompanyLevel.java b/src/main/java/com/adyen/service/management/ClientKeyCompanyLevel.java deleted file mode 100644 index bed01776b..000000000 --- a/src/main/java/com/adyen/service/management/ClientKeyCompanyLevel.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.GenerateClientKeyResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class ClientKeyCompanyLevel extends ApiKeyAuthenticatedService { - public ClientKeyCompanyLevel(Client client) { - super(client); - } - - /** - * Generate new client key - * - * @param companyId The unique identifier of the company account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @return GenerateClientKeyResponse - * @throws ApiException if fails to make API call - */ - public GenerateClientKeyResponse generateNewClientKey(String companyId, String apiCredentialId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("apiCredentialId", apiCredentialId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/apiCredentials/{apiCredentialId}/generateClientKey"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return GenerateClientKeyResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/ClientKeyCompanyLevelApi.java b/src/main/java/com/adyen/service/management/ClientKeyCompanyLevelApi.java new file mode 100644 index 000000000..05cb63275 --- /dev/null +++ b/src/main/java/com/adyen/service/management/ClientKeyCompanyLevelApi.java @@ -0,0 +1,73 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.GenerateClientKeyResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class ClientKeyCompanyLevelApi extends Service { + private final String baseURL; + + public ClientKeyCompanyLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Generate new client key + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @return {@link GenerateClientKeyResponse } + * @throws ApiException if fails to make API call + */ + public GenerateClientKeyResponse generateNewClientKey(String companyId, String apiCredentialId) throws ApiException, IOException { + return generateNewClientKey(companyId, apiCredentialId, null); + } + + /** + * Generate new client key + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GenerateClientKeyResponse } + * @throws ApiException if fails to make API call + */ + public GenerateClientKeyResponse generateNewClientKey(String companyId, String apiCredentialId, 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 (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/apiCredentials/{apiCredentialId}/generateClientKey", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return GenerateClientKeyResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/ClientKeyMerchantLevel.java b/src/main/java/com/adyen/service/management/ClientKeyMerchantLevel.java deleted file mode 100644 index 44ff86681..000000000 --- a/src/main/java/com/adyen/service/management/ClientKeyMerchantLevel.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.GenerateClientKeyResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class ClientKeyMerchantLevel extends ApiKeyAuthenticatedService { - public ClientKeyMerchantLevel(Client client) { - super(client); - } - - /** - * Generate new client key - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param apiCredentialId Unique identifier of the API credential. (required) - * @return GenerateClientKeyResponse - * @throws ApiException if fails to make API call - */ - public GenerateClientKeyResponse generateNewClientKey(String merchantId, String apiCredentialId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (apiCredentialId == null) { - throw new ApiException("Missing the required parameter 'apiCredentialId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("apiCredentialId", apiCredentialId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateClientKey"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return GenerateClientKeyResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/ClientKeyMerchantLevelApi.java b/src/main/java/com/adyen/service/management/ClientKeyMerchantLevelApi.java new file mode 100644 index 000000000..cea9e116b --- /dev/null +++ b/src/main/java/com/adyen/service/management/ClientKeyMerchantLevelApi.java @@ -0,0 +1,73 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.GenerateClientKeyResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class ClientKeyMerchantLevelApi extends Service { + private final String baseURL; + + public ClientKeyMerchantLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Generate new client key + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @return {@link GenerateClientKeyResponse } + * @throws ApiException if fails to make API call + */ + public GenerateClientKeyResponse generateNewClientKey(String merchantId, String apiCredentialId) throws ApiException, IOException { + return generateNewClientKey(merchantId, apiCredentialId, null); + } + + /** + * Generate new client key + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param apiCredentialId {@link String } Unique identifier of the API credential. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GenerateClientKeyResponse } + * @throws ApiException if fails to make API call + */ + public GenerateClientKeyResponse generateNewClientKey(String merchantId, String apiCredentialId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (apiCredentialId == null) { + throw new IllegalArgumentException("Please provide the apiCredentialId path parameter"); + } + pathParams.put("apiCredentialId", apiCredentialId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateClientKey", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return GenerateClientKeyResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/MyApiCredential.java b/src/main/java/com/adyen/service/management/MyApiCredential.java deleted file mode 100644 index 133bd7dcf..000000000 --- a/src/main/java/com/adyen/service/management/MyApiCredential.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.AllowedOrigin; -import com.adyen.model.management.AllowedOriginsResponse; -import com.adyen.model.management.CreateAllowedOriginRequest; -import com.adyen.model.management.MeApiCredential; -import com.adyen.model.management.RestServiceError; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class MyApiCredential extends ApiKeyAuthenticatedService { - public MyApiCredential(Client client) { - super(client); - } - - /** - * Remove allowed origin - * - * @param originId Unique identifier of the allowed origin. (required) - * @throws ApiException if fails to make API call - */ - public void removeAllowedOrigin(String originId) throws ApiException, IOException { - if (originId == null) { - throw new ApiException("Missing the required parameter 'originId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("originId", originId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/me/allowedOrigins/{originId}"); - resource.request(requestBody, null, ApiConstants.HttpMethod.DELETE, pathParams); - } - - /** - * Get API credential details - * - * @return MeApiCredential - * @throws ApiException if fails to make API call - */ - public MeApiCredential getApiCredentialDetails() throws ApiException, IOException { - - Map pathParams = new HashMap<>(); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/me"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return MeApiCredential.fromJson(jsonResult); - } - - /** - * Get allowed origins - * - * @return AllowedOriginsResponse - * @throws ApiException if fails to make API call - */ - public AllowedOriginsResponse getAllowedOrigins() throws ApiException, IOException { - - Map pathParams = new HashMap<>(); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/me/allowedOrigins"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return AllowedOriginsResponse.fromJson(jsonResult); - } - - /** - * Get allowed origin details - * - * @param originId Unique identifier of the allowed origin. (required) - * @return AllowedOrigin - * @throws ApiException if fails to make API call - */ - public AllowedOrigin getAllowedOriginDetails(String originId) throws ApiException, IOException { - if (originId == null) { - throw new ApiException("Missing the required parameter 'originId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("originId", originId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/me/allowedOrigins/{originId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return AllowedOrigin.fromJson(jsonResult); - } - - /** - * Add allowed origin - * - * @param createAllowedOriginRequest (optional) - * @return AllowedOriginsResponse - * @throws ApiException if fails to make API call - */ - public AllowedOriginsResponse addAllowedOrigin(CreateAllowedOriginRequest createAllowedOriginRequest) throws ApiException, IOException { - - Map pathParams = new HashMap<>(); - - String requestBody = createAllowedOriginRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/me/allowedOrigins"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return AllowedOriginsResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/MyApiCredentialApi.java b/src/main/java/com/adyen/service/management/MyApiCredentialApi.java new file mode 100644 index 000000000..aa8dc20ee --- /dev/null +++ b/src/main/java/com/adyen/service/management/MyApiCredentialApi.java @@ -0,0 +1,177 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.AllowedOrigin; +import com.adyen.model.management.AllowedOriginsResponse; +import com.adyen.model.management.CreateAllowedOriginRequest; +import com.adyen.model.management.MeApiCredential; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class MyApiCredentialApi extends Service { + private final String baseURL; + + public MyApiCredentialApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Remove allowed origin + * + * @param originId {@link String } Unique identifier of the allowed origin. (required) + * @throws ApiException if fails to make API call + */ + public void removeAllowedOrigin(String originId) throws ApiException, IOException { + removeAllowedOrigin(originId, null); + } + + /** + * Remove allowed origin + * + * @param originId {@link String } Unique identifier of the allowed origin. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @throws ApiException if fails to make API call + */ + public void removeAllowedOrigin(String originId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (originId == null) { + throw new IllegalArgumentException("Please provide the originId path parameter"); + } + pathParams.put("originId", originId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/me/allowedOrigins/{originId}", null); + resource.request(requestBody, null, ApiConstants.HttpMethod.DELETE, pathParams); + } + + /** + * Get API credential details + * + * @return {@link MeApiCredential } + * @throws ApiException if fails to make API call + */ + public MeApiCredential getApiCredentialDetails() throws ApiException, IOException { + return getApiCredentialDetails(null); + } + + /** + * Get API credential details + * + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link MeApiCredential } + * @throws ApiException if fails to make API call + */ + public MeApiCredential getApiCredentialDetails(RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/me", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, null); + return MeApiCredential.fromJson(jsonResult); + } + + /** + * Get allowed origins + * + * @return {@link AllowedOriginsResponse } + * @throws ApiException if fails to make API call + */ + public AllowedOriginsResponse getAllowedOrigins() throws ApiException, IOException { + return getAllowedOrigins(null); + } + + /** + * Get allowed origins + * + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AllowedOriginsResponse } + * @throws ApiException if fails to make API call + */ + public AllowedOriginsResponse getAllowedOrigins(RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/me/allowedOrigins", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, null); + return AllowedOriginsResponse.fromJson(jsonResult); + } + + /** + * Get allowed origin details + * + * @param originId {@link String } Unique identifier of the allowed origin. (required) + * @return {@link AllowedOrigin } + * @throws ApiException if fails to make API call + */ + public AllowedOrigin getAllowedOriginDetails(String originId) throws ApiException, IOException { + return getAllowedOriginDetails(originId, null); + } + + /** + * Get allowed origin details + * + * @param originId {@link String } Unique identifier of the allowed origin. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AllowedOrigin } + * @throws ApiException if fails to make API call + */ + public AllowedOrigin getAllowedOriginDetails(String originId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (originId == null) { + throw new IllegalArgumentException("Please provide the originId path parameter"); + } + pathParams.put("originId", originId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/me/allowedOrigins/{originId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return AllowedOrigin.fromJson(jsonResult); + } + + /** + * Add allowed origin + * + * @param createAllowedOriginRequest {@link CreateAllowedOriginRequest } (required) + * @return {@link AllowedOrigin } + * @throws ApiException if fails to make API call + */ + public AllowedOrigin addAllowedOrigin(CreateAllowedOriginRequest createAllowedOriginRequest) throws ApiException, IOException { + return addAllowedOrigin(createAllowedOriginRequest, null); + } + + /** + * Add allowed origin + * + * @param createAllowedOriginRequest {@link CreateAllowedOriginRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AllowedOrigin } + * @throws ApiException if fails to make API call + */ + public AllowedOrigin addAllowedOrigin(CreateAllowedOriginRequest createAllowedOriginRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = createAllowedOriginRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/me/allowedOrigins", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return AllowedOrigin.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevel.java b/src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevel.java deleted file mode 100644 index 9a5fae238..000000000 --- a/src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevel.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.ApplePayInfo; -import com.adyen.model.management.PaymentMethod; -import com.adyen.model.management.PaymentMethodResponse; -import com.adyen.model.management.PaymentMethodSetupInfo; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.UpdatePaymentMethodInfo; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class PaymentMethodsMerchantLevel extends ApiKeyAuthenticatedService { - public PaymentMethodsMerchantLevel(Client client) { - super(client); - } - - /** - * Get all payment methods - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param queryParams (optional) - * storeId: The unique identifier of the store for which to return the payment methods. (optional) - * businessLineId: The unique identifier of the Business Line for which to return the payment methods. (optional) - * pageSize: The number of items to have on a page, maximum 100. The default is 10 items on a page. (optional) - * pageNumber: The number of the page to fetch. (optional) - * @return PaymentMethodResponse - * @throws ApiException if fails to make API call - */ - public PaymentMethodResponse getAllPaymentMethods(String merchantId, Map queryParams) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/paymentMethodSettings"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return PaymentMethodResponse.fromJson(jsonResult); - } - - /** - * Get payment method details - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param paymentMethodId The unique identifier of the payment method. (required) - * @return PaymentMethod - * @throws ApiException if fails to make API call - */ - public PaymentMethod getPaymentMethodDetails(String merchantId, String paymentMethodId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (paymentMethodId == null) { - throw new ApiException("Missing the required parameter 'paymentMethodId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("paymentMethodId", paymentMethodId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return PaymentMethod.fromJson(jsonResult); - } - - /** - * Get Apple Pay domains - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param paymentMethodId The unique identifier of the payment method. (required) - * @return ApplePayInfo - * @throws ApiException if fails to make API call - */ - public ApplePayInfo getApplePayDomains(String merchantId, String paymentMethodId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (paymentMethodId == null) { - throw new ApiException("Missing the required parameter 'paymentMethodId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("paymentMethodId", paymentMethodId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/getApplePayDomains"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return ApplePayInfo.fromJson(jsonResult); - } - - /** - * Update a payment method - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param paymentMethodId The unique identifier of the payment method. (required) - * @param updatePaymentMethodInfo (optional) - * @return PaymentMethod - * @throws ApiException if fails to make API call - */ - public PaymentMethod updatePaymentMethod(String merchantId, String paymentMethodId, UpdatePaymentMethodInfo updatePaymentMethodInfo) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (paymentMethodId == null) { - throw new ApiException("Missing the required parameter 'paymentMethodId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("paymentMethodId", paymentMethodId); - - String requestBody = updatePaymentMethodInfo.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return PaymentMethod.fromJson(jsonResult); - } - - /** - * Request a payment method - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param paymentMethodSetupInfo (optional) - * @return PaymentMethod - * @throws ApiException if fails to make API call - */ - public PaymentMethod requestPaymentMethod(String merchantId, PaymentMethodSetupInfo paymentMethodSetupInfo) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = paymentMethodSetupInfo.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/paymentMethodSettings"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return PaymentMethod.fromJson(jsonResult); - } - - /** - * Add an Apple Pay domain - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param paymentMethodId The unique identifier of the payment method. (required) - * @param applePayInfo (optional) - * @throws ApiException if fails to make API call - */ - public void addApplePayDomain(String merchantId, String paymentMethodId, ApplePayInfo applePayInfo) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (paymentMethodId == null) { - throw new ApiException("Missing the required parameter 'paymentMethodId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("paymentMethodId", paymentMethodId); - - String requestBody = applePayInfo.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains"); - resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - } - -} diff --git a/src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevelApi.java b/src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevelApi.java new file mode 100644 index 000000000..37eb199cf --- /dev/null +++ b/src/main/java/com/adyen/service/management/PaymentMethodsMerchantLevelApi.java @@ -0,0 +1,281 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.ApplePayInfo; +import com.adyen.model.management.PaymentMethod; +import com.adyen.model.management.PaymentMethodResponse; +import com.adyen.model.management.PaymentMethodSetupInfo; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.UpdatePaymentMethodInfo; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class PaymentMethodsMerchantLevelApi extends Service { + private final String baseURL; + + public PaymentMethodsMerchantLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get all payment methods + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @return {@link PaymentMethodResponse } + * @throws ApiException if fails to make API call + */ + public PaymentMethodResponse getAllPaymentMethods(String merchantId) throws ApiException, IOException { + return getAllPaymentMethods(merchantId, null, null, null, null, null); + } + + /** + * Get all payment methods + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param storeId {@link String } Query: The unique identifier of the store for which to return the payment methods. (optional) + * @param businessLineId {@link String } Query: The unique identifier of the Business Line for which to return the payment methods. (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) + * @param pageNumber {@link Integer } Query: The number of the page to fetch. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentMethodResponse } + * @throws ApiException if fails to make API call + */ + public PaymentMethodResponse getAllPaymentMethods(String merchantId, String storeId, String businessLineId, Integer pageSize, Integer pageNumber, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + //Add query params + Map queryParams = new HashMap<>(); + if (storeId != null) { + queryParams.put("storeId", storeId); + } + if (businessLineId != null) { + queryParams.put("businessLineId", businessLineId); + } + if (pageSize != null) { + queryParams.put("pageSize", pageSize.toString()); + } + if (pageNumber != null) { + queryParams.put("pageNumber", pageNumber.toString()); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/paymentMethodSettings", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return PaymentMethodResponse.fromJson(jsonResult); + } + + /** + * Get payment method details + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param paymentMethodId {@link String } The unique identifier of the payment method. (required) + * @return {@link PaymentMethod } + * @throws ApiException if fails to make API call + */ + public PaymentMethod getPaymentMethodDetails(String merchantId, String paymentMethodId) throws ApiException, IOException { + return getPaymentMethodDetails(merchantId, paymentMethodId, null); + } + + /** + * Get payment method details + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param paymentMethodId {@link String } The unique identifier of the payment method. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentMethod } + * @throws ApiException if fails to make API call + */ + public PaymentMethod getPaymentMethodDetails(String merchantId, String paymentMethodId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (paymentMethodId == null) { + throw new IllegalArgumentException("Please provide the paymentMethodId path parameter"); + } + pathParams.put("paymentMethodId", paymentMethodId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return PaymentMethod.fromJson(jsonResult); + } + + /** + * Get Apple Pay domains + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param paymentMethodId {@link String } The unique identifier of the payment method. (required) + * @return {@link ApplePayInfo } + * @throws ApiException if fails to make API call + */ + public ApplePayInfo getApplePayDomains(String merchantId, String paymentMethodId) throws ApiException, IOException { + return getApplePayDomains(merchantId, paymentMethodId, null); + } + + /** + * Get Apple Pay domains + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param paymentMethodId {@link String } The unique identifier of the payment method. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ApplePayInfo } + * @throws ApiException if fails to make API call + */ + public ApplePayInfo getApplePayDomains(String merchantId, String paymentMethodId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (paymentMethodId == null) { + throw new IllegalArgumentException("Please provide the paymentMethodId path parameter"); + } + pathParams.put("paymentMethodId", paymentMethodId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/getApplePayDomains", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return ApplePayInfo.fromJson(jsonResult); + } + + /** + * Update a payment method + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param paymentMethodId {@link String } The unique identifier of the payment method. (required) + * @param updatePaymentMethodInfo {@link UpdatePaymentMethodInfo } (required) + * @return {@link PaymentMethod } + * @throws ApiException if fails to make API call + */ + public PaymentMethod updatePaymentMethod(String merchantId, String paymentMethodId, UpdatePaymentMethodInfo updatePaymentMethodInfo) throws ApiException, IOException { + return updatePaymentMethod(merchantId, paymentMethodId, updatePaymentMethodInfo, null); + } + + /** + * Update a payment method + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param paymentMethodId {@link String } The unique identifier of the payment method. (required) + * @param updatePaymentMethodInfo {@link UpdatePaymentMethodInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentMethod } + * @throws ApiException if fails to make API call + */ + public PaymentMethod updatePaymentMethod(String merchantId, String paymentMethodId, UpdatePaymentMethodInfo updatePaymentMethodInfo, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (paymentMethodId == null) { + throw new IllegalArgumentException("Please provide the paymentMethodId path parameter"); + } + pathParams.put("paymentMethodId", paymentMethodId); + + String requestBody = updatePaymentMethodInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return PaymentMethod.fromJson(jsonResult); + } + + /** + * Request a payment method + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param paymentMethodSetupInfo {@link PaymentMethodSetupInfo } (required) + * @return {@link PaymentMethod } + * @throws ApiException if fails to make API call + */ + public PaymentMethod requestPaymentMethod(String merchantId, PaymentMethodSetupInfo paymentMethodSetupInfo) throws ApiException, IOException { + return requestPaymentMethod(merchantId, paymentMethodSetupInfo, null); + } + + /** + * Request a payment method + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param paymentMethodSetupInfo {@link PaymentMethodSetupInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentMethod } + * @throws ApiException if fails to make API call + */ + public PaymentMethod requestPaymentMethod(String merchantId, PaymentMethodSetupInfo paymentMethodSetupInfo, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + + String requestBody = paymentMethodSetupInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/paymentMethodSettings", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return PaymentMethod.fromJson(jsonResult); + } + + /** + * Add an Apple Pay domain + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param paymentMethodId {@link String } The unique identifier of the payment method. (required) + * @param applePayInfo {@link ApplePayInfo } (required) + * @throws ApiException if fails to make API call + */ + public void addApplePayDomain(String merchantId, String paymentMethodId, ApplePayInfo applePayInfo) throws ApiException, IOException { + addApplePayDomain(merchantId, paymentMethodId, applePayInfo, null); + } + + /** + * Add an Apple Pay domain + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param paymentMethodId {@link String } The unique identifier of the payment method. (required) + * @param applePayInfo {@link ApplePayInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @throws ApiException if fails to make API call + */ + public void addApplePayDomain(String merchantId, String paymentMethodId, ApplePayInfo applePayInfo, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (paymentMethodId == null) { + throw new IllegalArgumentException("Please provide the paymentMethodId path parameter"); + } + pathParams.put("paymentMethodId", paymentMethodId); + + String requestBody = applePayInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains", null); + resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); + } +} diff --git a/src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevel.java b/src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevel.java deleted file mode 100644 index dbd3d436b..000000000 --- a/src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevel.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.PayoutSettings; -import com.adyen.model.management.PayoutSettingsRequest; -import com.adyen.model.management.PayoutSettingsResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.UpdatePayoutSettingsRequest; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class PayoutSettingsMerchantLevel extends ApiKeyAuthenticatedService { - public PayoutSettingsMerchantLevel(Client client) { - super(client); - } - - /** - * Delete a payout setting - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param payoutSettingsId The unique identifier of the payout setting. (required) - * @throws ApiException if fails to make API call - */ - public void deletePayoutSetting(String merchantId, String payoutSettingsId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (payoutSettingsId == null) { - throw new ApiException("Missing the required parameter 'payoutSettingsId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("payoutSettingsId", payoutSettingsId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}"); - resource.request(requestBody, null, ApiConstants.HttpMethod.DELETE, pathParams); - } - - /** - * Get a list of payout settings - * - * @param merchantId The unique identifier of the merchant account. (required) - * @return PayoutSettingsResponse - * @throws ApiException if fails to make API call - */ - public PayoutSettingsResponse listPayoutSettings(String merchantId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/payoutSettings"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return PayoutSettingsResponse.fromJson(jsonResult); - } - - /** - * Get a payout setting - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param payoutSettingsId The unique identifier of the payout setting. (required) - * @return PayoutSettings - * @throws ApiException if fails to make API call - */ - public PayoutSettings getPayoutSetting(String merchantId, String payoutSettingsId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (payoutSettingsId == null) { - throw new ApiException("Missing the required parameter 'payoutSettingsId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("payoutSettingsId", payoutSettingsId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return PayoutSettings.fromJson(jsonResult); - } - - /** - * Update a payout setting - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param payoutSettingsId The unique identifier of the payout setting. (required) - * @param updatePayoutSettingsRequest (optional) - * @return PayoutSettings - * @throws ApiException if fails to make API call - */ - public PayoutSettings updatePayoutSetting(String merchantId, String payoutSettingsId, UpdatePayoutSettingsRequest updatePayoutSettingsRequest) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (payoutSettingsId == null) { - throw new ApiException("Missing the required parameter 'payoutSettingsId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("payoutSettingsId", payoutSettingsId); - - String requestBody = updatePayoutSettingsRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return PayoutSettings.fromJson(jsonResult); - } - - /** - * Add a payout setting - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param payoutSettingsRequest (optional) - * @return PayoutSettings - * @throws ApiException if fails to make API call - */ - public PayoutSettings addPayoutSetting(String merchantId, PayoutSettingsRequest payoutSettingsRequest) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = payoutSettingsRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/payoutSettings"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return PayoutSettings.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevelApi.java b/src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevelApi.java new file mode 100644 index 000000000..162be437e --- /dev/null +++ b/src/main/java/com/adyen/service/management/PayoutSettingsMerchantLevelApi.java @@ -0,0 +1,221 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.PayoutSettings; +import com.adyen.model.management.PayoutSettingsRequest; +import com.adyen.model.management.PayoutSettingsResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.UpdatePayoutSettingsRequest; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class PayoutSettingsMerchantLevelApi extends Service { + private final String baseURL; + + public PayoutSettingsMerchantLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Delete a payout setting + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param payoutSettingsId {@link String } The unique identifier of the payout setting. (required) + * @throws ApiException if fails to make API call + */ + public void deletePayoutSetting(String merchantId, String payoutSettingsId) throws ApiException, IOException { + deletePayoutSetting(merchantId, payoutSettingsId, null); + } + + /** + * Delete a payout setting + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param payoutSettingsId {@link String } The unique identifier of the payout setting. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @throws ApiException if fails to make API call + */ + public void deletePayoutSetting(String merchantId, String payoutSettingsId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (payoutSettingsId == null) { + throw new IllegalArgumentException("Please provide the payoutSettingsId path parameter"); + } + pathParams.put("payoutSettingsId", payoutSettingsId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}", null); + resource.request(requestBody, null, ApiConstants.HttpMethod.DELETE, pathParams); + } + + /** + * Get a list of payout settings + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @return {@link PayoutSettingsResponse } + * @throws ApiException if fails to make API call + */ + public PayoutSettingsResponse listPayoutSettings(String merchantId) throws ApiException, IOException { + return listPayoutSettings(merchantId, null); + } + + /** + * Get a list of payout settings + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PayoutSettingsResponse } + * @throws ApiException if fails to make API call + */ + public PayoutSettingsResponse listPayoutSettings(String merchantId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/payoutSettings", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return PayoutSettingsResponse.fromJson(jsonResult); + } + + /** + * Get a payout setting + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param payoutSettingsId {@link String } The unique identifier of the payout setting. (required) + * @return {@link PayoutSettings } + * @throws ApiException if fails to make API call + */ + public PayoutSettings getPayoutSetting(String merchantId, String payoutSettingsId) throws ApiException, IOException { + return getPayoutSetting(merchantId, payoutSettingsId, null); + } + + /** + * Get a payout setting + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param payoutSettingsId {@link String } The unique identifier of the payout setting. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PayoutSettings } + * @throws ApiException if fails to make API call + */ + public PayoutSettings getPayoutSetting(String merchantId, String payoutSettingsId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (payoutSettingsId == null) { + throw new IllegalArgumentException("Please provide the payoutSettingsId path parameter"); + } + pathParams.put("payoutSettingsId", payoutSettingsId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return PayoutSettings.fromJson(jsonResult); + } + + /** + * Update a payout setting + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param payoutSettingsId {@link String } The unique identifier of the payout setting. (required) + * @param updatePayoutSettingsRequest {@link UpdatePayoutSettingsRequest } (required) + * @return {@link PayoutSettings } + * @throws ApiException if fails to make API call + */ + public PayoutSettings updatePayoutSetting(String merchantId, String payoutSettingsId, UpdatePayoutSettingsRequest updatePayoutSettingsRequest) throws ApiException, IOException { + return updatePayoutSetting(merchantId, payoutSettingsId, updatePayoutSettingsRequest, null); + } + + /** + * Update a payout setting + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param payoutSettingsId {@link String } The unique identifier of the payout setting. (required) + * @param updatePayoutSettingsRequest {@link UpdatePayoutSettingsRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PayoutSettings } + * @throws ApiException if fails to make API call + */ + public PayoutSettings updatePayoutSetting(String merchantId, String payoutSettingsId, UpdatePayoutSettingsRequest updatePayoutSettingsRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (payoutSettingsId == null) { + throw new IllegalArgumentException("Please provide the payoutSettingsId path parameter"); + } + pathParams.put("payoutSettingsId", payoutSettingsId); + + String requestBody = updatePayoutSettingsRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/payoutSettings/{payoutSettingsId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return PayoutSettings.fromJson(jsonResult); + } + + /** + * Add a payout setting + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param payoutSettingsRequest {@link PayoutSettingsRequest } (required) + * @return {@link PayoutSettings } + * @throws ApiException if fails to make API call + */ + public PayoutSettings addPayoutSetting(String merchantId, PayoutSettingsRequest payoutSettingsRequest) throws ApiException, IOException { + return addPayoutSetting(merchantId, payoutSettingsRequest, null); + } + + /** + * Add a payout setting + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param payoutSettingsRequest {@link PayoutSettingsRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PayoutSettings } + * @throws ApiException if fails to make API call + */ + public PayoutSettings addPayoutSetting(String merchantId, PayoutSettingsRequest payoutSettingsRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + + String requestBody = payoutSettingsRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/payoutSettings", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return PayoutSettings.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/TerminalActionsCompanyLevel.java b/src/main/java/com/adyen/service/management/TerminalActionsCompanyLevel.java deleted file mode 100644 index d80904af7..000000000 --- a/src/main/java/com/adyen/service/management/TerminalActionsCompanyLevel.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.AndroidAppsResponse; -import com.adyen.model.management.AndroidCertificatesResponse; -import com.adyen.model.management.ExternalTerminalAction; -import com.adyen.model.management.ListExternalTerminalActionsResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class TerminalActionsCompanyLevel extends ApiKeyAuthenticatedService { - public TerminalActionsCompanyLevel(Client client) { - super(client); - } - - /** - * Get a list of Android apps - * - * @param companyId The unique identifier of the company account. (required) - * @param queryParams (optional) - * pageNumber: The number of the page to fetch. (optional) - * pageSize: The number of items to have on a page, maximum 100. The default is 20 items on a page. (optional) - * @return AndroidAppsResponse - * @throws ApiException if fails to make API call - */ - public AndroidAppsResponse listAndroidApps(String companyId, Map queryParams) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/androidApps"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return AndroidAppsResponse.fromJson(jsonResult); - } - - /** - * Get a list of Android certificates - * - * @param companyId The unique identifier of the company account. (required) - * @param queryParams (optional) - * pageNumber: The number of the page to fetch. (optional) - * pageSize: The number of items to have on a page, maximum 100. The default is 20 items on a page. (optional) - * @return AndroidCertificatesResponse - * @throws ApiException if fails to make API call - */ - public AndroidCertificatesResponse listAndroidCertificates(String companyId, Map queryParams) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/androidCertificates"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return AndroidCertificatesResponse.fromJson(jsonResult); - } - - /** - * Get a list of terminal actions - * - * @param companyId The unique identifier of the company account. (required) - * @param queryParams (optional) - * pageNumber: The number of the page to fetch. (optional) - * pageSize: The number of items to have on a page, maximum 100. The default is 20 items on a page. (optional) - * status: Returns terminal actions with the specified status. Allowed values: **pending**, **successful**, **failed**, **cancelled**, **tryLater**. (optional) - * type: Returns terminal actions of the specified type. Allowed values: **InstallAndroidApp**, **UninstallAndroidApp**, **InstallAndroidCertificate**, **UninstallAndroidCertificate**. (optional) - * @return ListExternalTerminalActionsResponse - * @throws ApiException if fails to make API call - */ - public ListExternalTerminalActionsResponse listTerminalActions(String companyId, Map queryParams) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/terminalActions"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return ListExternalTerminalActionsResponse.fromJson(jsonResult); - } - - /** - * Get terminal action - * - * @param companyId The unique identifier of the company account. (required) - * @param actionId The unique identifier of the terminal action. (required) - * @return ExternalTerminalAction - * @throws ApiException if fails to make API call - */ - public ExternalTerminalAction getTerminalAction(String companyId, String actionId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (actionId == null) { - throw new ApiException("Missing the required parameter 'actionId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("actionId", actionId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/terminalActions/{actionId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return ExternalTerminalAction.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/TerminalActionsCompanyLevelApi.java b/src/main/java/com/adyen/service/management/TerminalActionsCompanyLevelApi.java new file mode 100644 index 000000000..0347632d7 --- /dev/null +++ b/src/main/java/com/adyen/service/management/TerminalActionsCompanyLevelApi.java @@ -0,0 +1,213 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.AndroidAppsResponse; +import com.adyen.model.management.AndroidCertificatesResponse; +import com.adyen.model.management.ExternalTerminalAction; +import com.adyen.model.management.ListExternalTerminalActionsResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class TerminalActionsCompanyLevelApi extends Service { + private final String baseURL; + + public TerminalActionsCompanyLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of Android apps + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @return {@link AndroidAppsResponse } + * @throws ApiException if fails to make API call + */ + public AndroidAppsResponse listAndroidApps(String companyId) throws ApiException, IOException { + return listAndroidApps(companyId, null, null, null); + } + + /** + * Get a list of Android apps + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @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 20 items on a page. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AndroidAppsResponse } + * @throws ApiException if fails to make API call + */ + public AndroidAppsResponse listAndroidApps(String companyId, 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); + //Add query params + Map queryParams = new HashMap<>(); + 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}/androidApps", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return AndroidAppsResponse.fromJson(jsonResult); + } + + /** + * Get a list of Android certificates + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @return {@link AndroidCertificatesResponse } + * @throws ApiException if fails to make API call + */ + public AndroidCertificatesResponse listAndroidCertificates(String companyId) throws ApiException, IOException { + return listAndroidCertificates(companyId, null, null, null); + } + + /** + * Get a list of Android certificates + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @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 20 items on a page. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AndroidCertificatesResponse } + * @throws ApiException if fails to make API call + */ + public AndroidCertificatesResponse listAndroidCertificates(String companyId, 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); + //Add query params + Map queryParams = new HashMap<>(); + 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}/androidCertificates", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return AndroidCertificatesResponse.fromJson(jsonResult); + } + + /** + * Get a list of terminal actions + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @return {@link ListExternalTerminalActionsResponse } + * @throws ApiException if fails to make API call + */ + public ListExternalTerminalActionsResponse listTerminalActions(String companyId) throws ApiException, IOException { + return listTerminalActions(companyId, null, null, null, null, null); + } + + /** + * Get a list of terminal actions + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @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 20 items on a page. (optional) + * @param status {@link String } Query: Returns terminal actions with the specified status. Allowed values: **pending**, **successful**, **failed**, **cancelled**, **tryLater**. (optional) + * @param type {@link String } Query: Returns terminal actions of the specified type. Allowed values: **InstallAndroidApp**, **UninstallAndroidApp**, **InstallAndroidCertificate**, **UninstallAndroidCertificate**. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ListExternalTerminalActionsResponse } + * @throws ApiException if fails to make API call + */ + public ListExternalTerminalActionsResponse listTerminalActions(String companyId, Integer pageNumber, Integer pageSize, String status, String type, 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 (pageNumber != null) { + queryParams.put("pageNumber", pageNumber.toString()); + } + if (pageSize != null) { + queryParams.put("pageSize", pageSize.toString()); + } + if (status != null) { + queryParams.put("status", status); + } + if (type != null) { + queryParams.put("type", type); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/terminalActions", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return ListExternalTerminalActionsResponse.fromJson(jsonResult); + } + + /** + * Get terminal action + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param actionId {@link String } The unique identifier of the terminal action. (required) + * @return {@link ExternalTerminalAction } + * @throws ApiException if fails to make API call + */ + public ExternalTerminalAction getTerminalAction(String companyId, String actionId) throws ApiException, IOException { + return getTerminalAction(companyId, actionId, null); + } + + /** + * Get terminal action + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param actionId {@link String } The unique identifier of the terminal action. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ExternalTerminalAction } + * @throws ApiException if fails to make API call + */ + public ExternalTerminalAction getTerminalAction(String companyId, String actionId, 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 (actionId == null) { + throw new IllegalArgumentException("Please provide the actionId path parameter"); + } + pathParams.put("actionId", actionId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/terminalActions/{actionId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return ExternalTerminalAction.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/TerminalActionsTerminalLevel.java b/src/main/java/com/adyen/service/management/TerminalActionsTerminalLevel.java deleted file mode 100644 index b61328909..000000000 --- a/src/main/java/com/adyen/service/management/TerminalActionsTerminalLevel.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.ScheduleTerminalActionsRequest; -import com.adyen.model.management.ScheduleTerminalActionsResponse; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class TerminalActionsTerminalLevel extends ApiKeyAuthenticatedService { - public TerminalActionsTerminalLevel(Client client) { - super(client); - } - - /** - * Create a terminal action - * - * @param scheduleTerminalActionsRequest (optional) - * @return ScheduleTerminalActionsResponse - * @throws ApiException if fails to make API call - */ - public ScheduleTerminalActionsResponse createTerminalAction(ScheduleTerminalActionsRequest scheduleTerminalActionsRequest) throws ApiException, IOException { - - Map pathParams = new HashMap<>(); - - String requestBody = scheduleTerminalActionsRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/terminals/scheduleActions"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return ScheduleTerminalActionsResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/TerminalActionsTerminalLevelApi.java b/src/main/java/com/adyen/service/management/TerminalActionsTerminalLevelApi.java new file mode 100644 index 000000000..e7c31447b --- /dev/null +++ b/src/main/java/com/adyen/service/management/TerminalActionsTerminalLevelApi.java @@ -0,0 +1,62 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.ScheduleTerminalActionsRequest; +import com.adyen.model.management.ScheduleTerminalActionsResponse; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class TerminalActionsTerminalLevelApi extends Service { + private final String baseURL; + + public TerminalActionsTerminalLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Create a terminal action + * + * @param scheduleTerminalActionsRequest {@link ScheduleTerminalActionsRequest } (required) + * @return {@link ScheduleTerminalActionsResponse } + * @throws ApiException if fails to make API call + */ + public ScheduleTerminalActionsResponse createTerminalAction(ScheduleTerminalActionsRequest scheduleTerminalActionsRequest) throws ApiException, IOException { + return createTerminalAction(scheduleTerminalActionsRequest, null); + } + + /** + * Create a terminal action + * + * @param scheduleTerminalActionsRequest {@link ScheduleTerminalActionsRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ScheduleTerminalActionsResponse } + * @throws ApiException if fails to make API call + */ + public ScheduleTerminalActionsResponse createTerminalAction(ScheduleTerminalActionsRequest scheduleTerminalActionsRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = scheduleTerminalActionsRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/terminals/scheduleActions", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return ScheduleTerminalActionsResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevel.java b/src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevel.java deleted file mode 100644 index 4336f7939..000000000 --- a/src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevel.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.BillingEntitiesResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.ShippingLocation; -import com.adyen.model.management.ShippingLocationsResponse; -import com.adyen.model.management.TerminalModelsResponse; -import com.adyen.model.management.TerminalOrder; -import com.adyen.model.management.TerminalOrderRequest; -import com.adyen.model.management.TerminalOrdersResponse; -import com.adyen.model.management.TerminalProductsResponse; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class TerminalOrdersCompanyLevel extends ApiKeyAuthenticatedService { - public TerminalOrdersCompanyLevel(Client client) { - super(client); - } - - /** - * Get a list of billing entities - * - * @param companyId The unique identifier of the company account. (required) - * @param queryParams (optional) - * name: The name of the billing entity. (optional) - * @return BillingEntitiesResponse - * @throws ApiException if fails to make API call - */ - public BillingEntitiesResponse listBillingEntities(String companyId, Map queryParams) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/billingEntities"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return BillingEntitiesResponse.fromJson(jsonResult); - } - - /** - * Get a list of shipping locations - * - * @param companyId The unique identifier of the company account. (required) - * @param queryParams (optional) - * name: The name of the shipping location. (optional) - * offset: The number of locations to skip. (optional) - * limit: The number of locations to return. (optional) - * @return ShippingLocationsResponse - * @throws ApiException if fails to make API call - */ - public ShippingLocationsResponse listShippingLocations(String companyId, Map queryParams) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/shippingLocations"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return ShippingLocationsResponse.fromJson(jsonResult); - } - - /** - * Get a list of terminal models - * - * @param companyId The unique identifier of the company account. (required) - * @return TerminalModelsResponse - * @throws ApiException if fails to make API call - */ - public TerminalModelsResponse listTerminalModels(String companyId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/terminalModels"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return TerminalModelsResponse.fromJson(jsonResult); - } - - /** - * Get a list of orders - * - * @param companyId The unique identifier of the company account. (required) - * @param queryParams (optional) - * customerOrderReference: Your purchase order number. (optional) - * status: The order status. Possible values (not case-sensitive): Placed, Confirmed, Cancelled, Shipped, Delivered. (optional) - * offset: The number of orders to skip. (optional) - * limit: The number of orders to return. (optional) - * @return TerminalOrdersResponse - * @throws ApiException if fails to make API call - */ - public TerminalOrdersResponse listOrders(String companyId, Map queryParams) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/terminalOrders"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return TerminalOrdersResponse.fromJson(jsonResult); - } - - /** - * Get an order - * - * @param companyId The unique identifier of the company account. (required) - * @param orderId The unique identifier of the order. (required) - * @return TerminalOrder - * @throws ApiException if fails to make API call - */ - public TerminalOrder getOrder(String companyId, String orderId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (orderId == null) { - throw new ApiException("Missing the required parameter 'orderId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("orderId", orderId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/terminalOrders/{orderId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return TerminalOrder.fromJson(jsonResult); - } - - /** - * Get a list of terminal products - * - * @param companyId The unique identifier of the company account. (required) - * @param queryParams (optional) - * country: The country to return products for, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. For example, **US** (optional) - * terminalModelId: The terminal model to return products for. Use the ID returned in the [GET `/terminalModels`](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/terminalModels) response. For example, **Verifone.M400** (optional) - * offset: The number of products to skip. (optional) - * limit: The number of products to return. (optional) - * @return TerminalProductsResponse - * @throws ApiException if fails to make API call - */ - public TerminalProductsResponse listTerminalProducts(String companyId, Map queryParams) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/terminalProducts"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return TerminalProductsResponse.fromJson(jsonResult); - } - - /** - * Update an order - * - * @param companyId The unique identifier of the company account. (required) - * @param orderId The unique identifier of the order. (required) - * @param terminalOrderRequest (optional) - * @return TerminalOrder - * @throws ApiException if fails to make API call - */ - public TerminalOrder updateOrder(String companyId, String orderId, TerminalOrderRequest terminalOrderRequest) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (orderId == null) { - throw new ApiException("Missing the required parameter 'orderId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("orderId", orderId); - - String requestBody = terminalOrderRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/terminalOrders/{orderId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return TerminalOrder.fromJson(jsonResult); - } - - /** - * Create a shipping location - * - * @param companyId The unique identifier of the company account. (required) - * @param shippingLocation (optional) - * @return ShippingLocation - * @throws ApiException if fails to make API call - */ - public ShippingLocation createShippingLocation(String companyId, ShippingLocation shippingLocation) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = shippingLocation.toJson(); - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/shippingLocations"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return ShippingLocation.fromJson(jsonResult); - } - - /** - * Create an order - * - * @param companyId The unique identifier of the company account. (required) - * @param terminalOrderRequest (optional) - * @return TerminalOrder - * @throws ApiException if fails to make API call - */ - public TerminalOrder createOrder(String companyId, TerminalOrderRequest terminalOrderRequest) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = terminalOrderRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/terminalOrders"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return TerminalOrder.fromJson(jsonResult); - } - - /** - * Cancel an order - * - * @param companyId The unique identifier of the company account. (required) - * @param orderId The unique identifier of the order. (required) - * @return TerminalOrder - * @throws ApiException if fails to make API call - */ - public TerminalOrder cancelOrder(String companyId, String orderId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (orderId == null) { - throw new ApiException("Missing the required parameter 'orderId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("orderId", orderId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/terminalOrders/{orderId}/cancel"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return TerminalOrder.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevelApi.java b/src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevelApi.java new file mode 100644 index 000000000..28d604a60 --- /dev/null +++ b/src/main/java/com/adyen/service/management/TerminalOrdersCompanyLevelApi.java @@ -0,0 +1,452 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.BillingEntitiesResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.ShippingLocation; +import com.adyen.model.management.ShippingLocationsResponse; +import com.adyen.model.management.TerminalModelsResponse; +import com.adyen.model.management.TerminalOrder; +import com.adyen.model.management.TerminalOrderRequest; +import com.adyen.model.management.TerminalOrdersResponse; +import com.adyen.model.management.TerminalProductsResponse; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class TerminalOrdersCompanyLevelApi extends Service { + private final String baseURL; + + public TerminalOrdersCompanyLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of billing entities + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @return {@link BillingEntitiesResponse } + * @throws ApiException if fails to make API call + */ + public BillingEntitiesResponse listBillingEntities(String companyId) throws ApiException, IOException { + return listBillingEntities(companyId, null, null); + } + + /** + * Get a list of billing entities + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param name {@link String } Query: The name of the billing entity. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link BillingEntitiesResponse } + * @throws ApiException if fails to make API call + */ + public BillingEntitiesResponse listBillingEntities(String companyId, String name, 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 (name != null) { + queryParams.put("name", name); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/billingEntities", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return BillingEntitiesResponse.fromJson(jsonResult); + } + + /** + * Get a list of shipping locations + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @return {@link ShippingLocationsResponse } + * @throws ApiException if fails to make API call + */ + public ShippingLocationsResponse listShippingLocations(String companyId) throws ApiException, IOException { + return listShippingLocations(companyId, null, null, null, null); + } + + /** + * Get a list of shipping locations + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param name {@link String } Query: The name of the shipping location. (optional) + * @param offset {@link Integer } Query: The number of locations to skip. (optional) + * @param limit {@link Integer } Query: The number of locations to return. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ShippingLocationsResponse } + * @throws ApiException if fails to make API call + */ + public ShippingLocationsResponse listShippingLocations(String companyId, String name, Integer offset, Integer limit, 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 (name != null) { + queryParams.put("name", name); + } + if (offset != null) { + queryParams.put("offset", offset.toString()); + } + if (limit != null) { + queryParams.put("limit", limit.toString()); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/shippingLocations", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return ShippingLocationsResponse.fromJson(jsonResult); + } + + /** + * Get a list of terminal models + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @return {@link TerminalModelsResponse } + * @throws ApiException if fails to make API call + */ + public TerminalModelsResponse listTerminalModels(String companyId) throws ApiException, IOException { + return listTerminalModels(companyId, null); + } + + /** + * Get a list of terminal models + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalModelsResponse } + * @throws ApiException if fails to make API call + */ + public TerminalModelsResponse listTerminalModels(String companyId, 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 = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/terminalModels", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return TerminalModelsResponse.fromJson(jsonResult); + } + + /** + * Get a list of orders + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @return {@link TerminalOrdersResponse } + * @throws ApiException if fails to make API call + */ + public TerminalOrdersResponse listOrders(String companyId) throws ApiException, IOException { + return listOrders(companyId, null, null, null, null, null); + } + + /** + * Get a list of orders + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param customerOrderReference {@link String } Query: Your purchase order number. (optional) + * @param status {@link String } Query: The order status. Possible values (not case-sensitive): Placed, Confirmed, Cancelled, Shipped, Delivered. (optional) + * @param offset {@link Integer } Query: The number of orders to skip. (optional) + * @param limit {@link Integer } Query: The number of orders to return. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalOrdersResponse } + * @throws ApiException if fails to make API call + */ + public TerminalOrdersResponse listOrders(String companyId, String customerOrderReference, String status, Integer offset, Integer limit, 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 (customerOrderReference != null) { + queryParams.put("customerOrderReference", customerOrderReference); + } + if (status != null) { + queryParams.put("status", status); + } + if (offset != null) { + queryParams.put("offset", offset.toString()); + } + if (limit != null) { + queryParams.put("limit", limit.toString()); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/terminalOrders", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return TerminalOrdersResponse.fromJson(jsonResult); + } + + /** + * Get an order + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param orderId {@link String } The unique identifier of the order. (required) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder getOrder(String companyId, String orderId) throws ApiException, IOException { + return getOrder(companyId, orderId, null); + } + + /** + * Get an order + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param orderId {@link String } The unique identifier of the order. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder getOrder(String companyId, String orderId, 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 (orderId == null) { + throw new IllegalArgumentException("Please provide the orderId path parameter"); + } + pathParams.put("orderId", orderId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/terminalOrders/{orderId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return TerminalOrder.fromJson(jsonResult); + } + + /** + * Get a list of terminal products + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param country {@link String } The country to return products for, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. For example, **US** (required) + * @return {@link TerminalProductsResponse } + * @throws ApiException if fails to make API call + */ + public TerminalProductsResponse listTerminalProducts(String companyId, String country) throws ApiException, IOException { + return listTerminalProducts(companyId, country, null, null, null, null); + } + + /** + * Get a list of terminal products + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param country {@link String } Query: The country to return products for, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. For example, **US** (required) + * @param terminalModelId {@link String } Query: The terminal model to return products for. Use the ID returned in the [GET `/terminalModels`](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/companies/{companyId}/terminalModels) response. For example, **Verifone.M400** (optional) + * @param offset {@link Integer } Query: The number of products to skip. (optional) + * @param limit {@link Integer } Query: The number of products to return. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalProductsResponse } + * @throws ApiException if fails to make API call + */ + public TerminalProductsResponse listTerminalProducts(String companyId, String country, String terminalModelId, Integer offset, Integer limit, 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 (country != null) { + queryParams.put("country", country); + } + if (terminalModelId != null) { + queryParams.put("terminalModelId", terminalModelId); + } + if (offset != null) { + queryParams.put("offset", offset.toString()); + } + if (limit != null) { + queryParams.put("limit", limit.toString()); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/terminalProducts", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return TerminalProductsResponse.fromJson(jsonResult); + } + + /** + * Update an order + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param orderId {@link String } The unique identifier of the order. (required) + * @param terminalOrderRequest {@link TerminalOrderRequest } (required) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder updateOrder(String companyId, String orderId, TerminalOrderRequest terminalOrderRequest) throws ApiException, IOException { + return updateOrder(companyId, orderId, terminalOrderRequest, null); + } + + /** + * Update an order + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param orderId {@link String } The unique identifier of the order. (required) + * @param terminalOrderRequest {@link TerminalOrderRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder updateOrder(String companyId, String orderId, TerminalOrderRequest terminalOrderRequest, 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 (orderId == null) { + throw new IllegalArgumentException("Please provide the orderId path parameter"); + } + pathParams.put("orderId", orderId); + + String requestBody = terminalOrderRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/terminalOrders/{orderId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return TerminalOrder.fromJson(jsonResult); + } + + /** + * Create a shipping location + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param shippingLocation {@link ShippingLocation } (required) + * @return {@link ShippingLocation } + * @throws ApiException if fails to make API call + */ + public ShippingLocation createShippingLocation(String companyId, ShippingLocation shippingLocation) throws ApiException, IOException { + return createShippingLocation(companyId, shippingLocation, null); + } + + /** + * Create a shipping location + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param shippingLocation {@link ShippingLocation } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ShippingLocation } + * @throws ApiException if fails to make API call + */ + public ShippingLocation createShippingLocation(String companyId, ShippingLocation shippingLocation, 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 = shippingLocation.toJson(); + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/shippingLocations", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return ShippingLocation.fromJson(jsonResult); + } + + /** + * Create an order + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param terminalOrderRequest {@link TerminalOrderRequest } (required) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder createOrder(String companyId, TerminalOrderRequest terminalOrderRequest) throws ApiException, IOException { + return createOrder(companyId, terminalOrderRequest, null); + } + + /** + * Create an order + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param terminalOrderRequest {@link TerminalOrderRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder createOrder(String companyId, TerminalOrderRequest terminalOrderRequest, 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 = terminalOrderRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/terminalOrders", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return TerminalOrder.fromJson(jsonResult); + } + + /** + * Cancel an order + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param orderId {@link String } The unique identifier of the order. (required) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder cancelOrder(String companyId, String orderId) throws ApiException, IOException { + return cancelOrder(companyId, orderId, null); + } + + /** + * Cancel an order + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param orderId {@link String } The unique identifier of the order. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder cancelOrder(String companyId, String orderId, 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 (orderId == null) { + throw new IllegalArgumentException("Please provide the orderId path parameter"); + } + pathParams.put("orderId", orderId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/terminalOrders/{orderId}/cancel", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return TerminalOrder.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevel.java b/src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevel.java deleted file mode 100644 index 49f74bd6f..000000000 --- a/src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevel.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.BillingEntitiesResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.ShippingLocation; -import com.adyen.model.management.ShippingLocationsResponse; -import com.adyen.model.management.TerminalModelsResponse; -import com.adyen.model.management.TerminalOrder; -import com.adyen.model.management.TerminalOrderRequest; -import com.adyen.model.management.TerminalOrdersResponse; -import com.adyen.model.management.TerminalProductsResponse; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class TerminalOrdersMerchantLevel extends ApiKeyAuthenticatedService { - public TerminalOrdersMerchantLevel(Client client) { - super(client); - } - - /** - * Get a list of billing entities - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param queryParams (optional) - * name: The name of the billing entity. (optional) - * @return BillingEntitiesResponse - * @throws ApiException if fails to make API call - */ - public BillingEntitiesResponse listBillingEntities(String merchantId, Map queryParams) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/billingEntities"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return BillingEntitiesResponse.fromJson(jsonResult); - } - - /** - * Get a list of shipping locations - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param queryParams (optional) - * name: The name of the shipping location. (optional) - * offset: The number of locations to skip. (optional) - * limit: The number of locations to return. (optional) - * @return ShippingLocationsResponse - * @throws ApiException if fails to make API call - */ - public ShippingLocationsResponse listShippingLocations(String merchantId, Map queryParams) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/shippingLocations"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return ShippingLocationsResponse.fromJson(jsonResult); - } - - /** - * Get a list of terminal models - * - * @param merchantId The unique identifier of the merchant account. (required) - * @return TerminalModelsResponse - * @throws ApiException if fails to make API call - */ - public TerminalModelsResponse listTerminalModels(String merchantId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/terminalModels"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return TerminalModelsResponse.fromJson(jsonResult); - } - - /** - * Get a list of orders - * - * @param merchantId (required) - * @param queryParams (optional) - * customerOrderReference: Your purchase order number. (optional) - * status: The order status. Possible values (not case-sensitive): Placed, Confirmed, Cancelled, Shipped, Delivered. (optional) - * offset: The number of orders to skip. (optional) - * limit: The number of orders to return. (optional) - * @return TerminalOrdersResponse - * @throws ApiException if fails to make API call - */ - public TerminalOrdersResponse listOrders(String merchantId, Map queryParams) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/terminalOrders"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return TerminalOrdersResponse.fromJson(jsonResult); - } - - /** - * Get an order - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param orderId The unique identifier of the order. (required) - * @return TerminalOrder - * @throws ApiException if fails to make API call - */ - public TerminalOrder getOrder(String merchantId, String orderId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (orderId == null) { - throw new ApiException("Missing the required parameter 'orderId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("orderId", orderId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/terminalOrders/{orderId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return TerminalOrder.fromJson(jsonResult); - } - - /** - * Get a list of terminal products - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param queryParams (optional) - * country: The country to return products for, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. For example, **US** (optional) - * terminalModelId: The terminal model to return products for. Use the ID returned in the [GET `/terminalModels`](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/terminalModels) response. For example, **Verifone.M400** (optional) - * offset: The number of products to skip. (optional) - * limit: The number of products to return. (optional) - * @return TerminalProductsResponse - * @throws ApiException if fails to make API call - */ - public TerminalProductsResponse listTerminalProducts(String merchantId, Map queryParams) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/terminalProducts"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return TerminalProductsResponse.fromJson(jsonResult); - } - - /** - * Update an order - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param orderId The unique identifier of the order. (required) - * @param terminalOrderRequest (optional) - * @return TerminalOrder - * @throws ApiException if fails to make API call - */ - public TerminalOrder updateOrder(String merchantId, String orderId, TerminalOrderRequest terminalOrderRequest) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (orderId == null) { - throw new ApiException("Missing the required parameter 'orderId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("orderId", orderId); - - String requestBody = terminalOrderRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/terminalOrders/{orderId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return TerminalOrder.fromJson(jsonResult); - } - - /** - * Create a shipping location - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param shippingLocation (optional) - * @return ShippingLocation - * @throws ApiException if fails to make API call - */ - public ShippingLocation createShippingLocation(String merchantId, ShippingLocation shippingLocation) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = shippingLocation.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/shippingLocations"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return ShippingLocation.fromJson(jsonResult); - } - - /** - * Create an order - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param terminalOrderRequest (optional) - * @return TerminalOrder - * @throws ApiException if fails to make API call - */ - public TerminalOrder createOrder(String merchantId, TerminalOrderRequest terminalOrderRequest) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = terminalOrderRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/terminalOrders"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return TerminalOrder.fromJson(jsonResult); - } - - /** - * Cancel an order - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param orderId The unique identifier of the order. (required) - * @return TerminalOrder - * @throws ApiException if fails to make API call - */ - public TerminalOrder cancelOrder(String merchantId, String orderId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (orderId == null) { - throw new ApiException("Missing the required parameter 'orderId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("orderId", orderId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/terminalOrders/{orderId}/cancel"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return TerminalOrder.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevelApi.java b/src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevelApi.java new file mode 100644 index 000000000..a9d5bc71c --- /dev/null +++ b/src/main/java/com/adyen/service/management/TerminalOrdersMerchantLevelApi.java @@ -0,0 +1,452 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.BillingEntitiesResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.ShippingLocation; +import com.adyen.model.management.ShippingLocationsResponse; +import com.adyen.model.management.TerminalModelsResponse; +import com.adyen.model.management.TerminalOrder; +import com.adyen.model.management.TerminalOrderRequest; +import com.adyen.model.management.TerminalOrdersResponse; +import com.adyen.model.management.TerminalProductsResponse; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class TerminalOrdersMerchantLevelApi extends Service { + private final String baseURL; + + public TerminalOrdersMerchantLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of billing entities + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @return {@link BillingEntitiesResponse } + * @throws ApiException if fails to make API call + */ + public BillingEntitiesResponse listBillingEntities(String merchantId) throws ApiException, IOException { + return listBillingEntities(merchantId, null, null); + } + + /** + * Get a list of billing entities + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param name {@link String } Query: The name of the billing entity. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link BillingEntitiesResponse } + * @throws ApiException if fails to make API call + */ + public BillingEntitiesResponse listBillingEntities(String merchantId, String name, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + //Add query params + Map queryParams = new HashMap<>(); + if (name != null) { + queryParams.put("name", name); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/billingEntities", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return BillingEntitiesResponse.fromJson(jsonResult); + } + + /** + * Get a list of shipping locations + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @return {@link ShippingLocationsResponse } + * @throws ApiException if fails to make API call + */ + public ShippingLocationsResponse listShippingLocations(String merchantId) throws ApiException, IOException { + return listShippingLocations(merchantId, null, null, null, null); + } + + /** + * Get a list of shipping locations + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param name {@link String } Query: The name of the shipping location. (optional) + * @param offset {@link Integer } Query: The number of locations to skip. (optional) + * @param limit {@link Integer } Query: The number of locations to return. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ShippingLocationsResponse } + * @throws ApiException if fails to make API call + */ + public ShippingLocationsResponse listShippingLocations(String merchantId, String name, Integer offset, Integer limit, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + //Add query params + Map queryParams = new HashMap<>(); + if (name != null) { + queryParams.put("name", name); + } + if (offset != null) { + queryParams.put("offset", offset.toString()); + } + if (limit != null) { + queryParams.put("limit", limit.toString()); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/shippingLocations", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return ShippingLocationsResponse.fromJson(jsonResult); + } + + /** + * Get a list of terminal models + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @return {@link TerminalModelsResponse } + * @throws ApiException if fails to make API call + */ + public TerminalModelsResponse listTerminalModels(String merchantId) throws ApiException, IOException { + return listTerminalModels(merchantId, null); + } + + /** + * Get a list of terminal models + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalModelsResponse } + * @throws ApiException if fails to make API call + */ + public TerminalModelsResponse listTerminalModels(String merchantId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/terminalModels", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return TerminalModelsResponse.fromJson(jsonResult); + } + + /** + * Get a list of orders + * + * @param merchantId {@link String } (required) + * @return {@link TerminalOrdersResponse } + * @throws ApiException if fails to make API call + */ + public TerminalOrdersResponse listOrders(String merchantId) throws ApiException, IOException { + return listOrders(merchantId, null, null, null, null, null); + } + + /** + * Get a list of orders + * + * @param merchantId {@link String } (required) + * @param customerOrderReference {@link String } Query: Your purchase order number. (optional) + * @param status {@link String } Query: The order status. Possible values (not case-sensitive): Placed, Confirmed, Cancelled, Shipped, Delivered. (optional) + * @param offset {@link Integer } Query: The number of orders to skip. (optional) + * @param limit {@link Integer } Query: The number of orders to return. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalOrdersResponse } + * @throws ApiException if fails to make API call + */ + public TerminalOrdersResponse listOrders(String merchantId, String customerOrderReference, String status, Integer offset, Integer limit, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + //Add query params + Map queryParams = new HashMap<>(); + if (customerOrderReference != null) { + queryParams.put("customerOrderReference", customerOrderReference); + } + if (status != null) { + queryParams.put("status", status); + } + if (offset != null) { + queryParams.put("offset", offset.toString()); + } + if (limit != null) { + queryParams.put("limit", limit.toString()); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/terminalOrders", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return TerminalOrdersResponse.fromJson(jsonResult); + } + + /** + * Get an order + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param orderId {@link String } The unique identifier of the order. (required) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder getOrder(String merchantId, String orderId) throws ApiException, IOException { + return getOrder(merchantId, orderId, null); + } + + /** + * Get an order + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param orderId {@link String } The unique identifier of the order. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder getOrder(String merchantId, String orderId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (orderId == null) { + throw new IllegalArgumentException("Please provide the orderId path parameter"); + } + pathParams.put("orderId", orderId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/terminalOrders/{orderId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return TerminalOrder.fromJson(jsonResult); + } + + /** + * Get a list of terminal products + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param country {@link String } The country to return products for, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. For example, **US** (required) + * @return {@link TerminalProductsResponse } + * @throws ApiException if fails to make API call + */ + public TerminalProductsResponse listTerminalProducts(String merchantId, String country) throws ApiException, IOException { + return listTerminalProducts(merchantId, country, null, null, null, null); + } + + /** + * Get a list of terminal products + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param country {@link String } Query: The country to return products for, in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. For example, **US** (required) + * @param terminalModelId {@link String } Query: The terminal model to return products for. Use the ID returned in the [GET `/terminalModels`](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/merchants/{merchantId}/terminalModels) response. For example, **Verifone.M400** (optional) + * @param offset {@link Integer } Query: The number of products to skip. (optional) + * @param limit {@link Integer } Query: The number of products to return. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalProductsResponse } + * @throws ApiException if fails to make API call + */ + public TerminalProductsResponse listTerminalProducts(String merchantId, String country, String terminalModelId, Integer offset, Integer limit, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + //Add query params + Map queryParams = new HashMap<>(); + if (country != null) { + queryParams.put("country", country); + } + if (terminalModelId != null) { + queryParams.put("terminalModelId", terminalModelId); + } + if (offset != null) { + queryParams.put("offset", offset.toString()); + } + if (limit != null) { + queryParams.put("limit", limit.toString()); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/terminalProducts", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return TerminalProductsResponse.fromJson(jsonResult); + } + + /** + * Update an order + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param orderId {@link String } The unique identifier of the order. (required) + * @param terminalOrderRequest {@link TerminalOrderRequest } (required) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder updateOrder(String merchantId, String orderId, TerminalOrderRequest terminalOrderRequest) throws ApiException, IOException { + return updateOrder(merchantId, orderId, terminalOrderRequest, null); + } + + /** + * Update an order + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param orderId {@link String } The unique identifier of the order. (required) + * @param terminalOrderRequest {@link TerminalOrderRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder updateOrder(String merchantId, String orderId, TerminalOrderRequest terminalOrderRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (orderId == null) { + throw new IllegalArgumentException("Please provide the orderId path parameter"); + } + pathParams.put("orderId", orderId); + + String requestBody = terminalOrderRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/terminalOrders/{orderId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return TerminalOrder.fromJson(jsonResult); + } + + /** + * Create a shipping location + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param shippingLocation {@link ShippingLocation } (required) + * @return {@link ShippingLocation } + * @throws ApiException if fails to make API call + */ + public ShippingLocation createShippingLocation(String merchantId, ShippingLocation shippingLocation) throws ApiException, IOException { + return createShippingLocation(merchantId, shippingLocation, null); + } + + /** + * Create a shipping location + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param shippingLocation {@link ShippingLocation } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ShippingLocation } + * @throws ApiException if fails to make API call + */ + public ShippingLocation createShippingLocation(String merchantId, ShippingLocation shippingLocation, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + + String requestBody = shippingLocation.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/shippingLocations", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return ShippingLocation.fromJson(jsonResult); + } + + /** + * Create an order + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param terminalOrderRequest {@link TerminalOrderRequest } (required) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder createOrder(String merchantId, TerminalOrderRequest terminalOrderRequest) throws ApiException, IOException { + return createOrder(merchantId, terminalOrderRequest, null); + } + + /** + * Create an order + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param terminalOrderRequest {@link TerminalOrderRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder createOrder(String merchantId, TerminalOrderRequest terminalOrderRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + + String requestBody = terminalOrderRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/terminalOrders", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return TerminalOrder.fromJson(jsonResult); + } + + /** + * Cancel an order + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param orderId {@link String } The unique identifier of the order. (required) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder cancelOrder(String merchantId, String orderId) throws ApiException, IOException { + return cancelOrder(merchantId, orderId, null); + } + + /** + * Cancel an order + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param orderId {@link String } The unique identifier of the order. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalOrder } + * @throws ApiException if fails to make API call + */ + public TerminalOrder cancelOrder(String merchantId, String orderId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (orderId == null) { + throw new IllegalArgumentException("Please provide the orderId path parameter"); + } + pathParams.put("orderId", orderId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/terminalOrders/{orderId}/cancel", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return TerminalOrder.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevel.java b/src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevel.java deleted file mode 100644 index 1f342d956..000000000 --- a/src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevel.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.Logo; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.TerminalSettings; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class TerminalSettingsCompanyLevel extends ApiKeyAuthenticatedService { - public TerminalSettingsCompanyLevel(Client client) { - super(client); - } - - /** - * Get the terminal logo - * - * @param companyId The unique identifier of the company account. (required) - * @param queryParams (optional) - * model: The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (optional) - * @return Logo - * @throws ApiException if fails to make API call - */ - public Logo getTheTerminalLogo(String companyId, Map queryParams) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/terminalLogos"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return Logo.fromJson(jsonResult); - } - - /** - * Get terminal settings - * - * @param companyId The unique identifier of the company account. (required) - * @return TerminalSettings - * @throws ApiException if fails to make API call - */ - public TerminalSettings getTerminalSettings(String companyId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/terminalSettings"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return TerminalSettings.fromJson(jsonResult); - } - - /** - * Update the terminal logo - * - * @param companyId The unique identifier of the company account. (required) - * @param logo (optional) - * @param queryParams (optional) - * model: The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (optional) - * @return Logo - * @throws ApiException if fails to make API call - */ - public Logo updateTheTerminalLogo(String companyId, Logo logo, Map queryParams) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = logo.toJson(); - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/terminalLogos"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams, queryParams); - return Logo.fromJson(jsonResult); - } - - /** - * Update terminal settings - * - * @param companyId The unique identifier of the company account. (required) - * @param terminalSettings (optional) - * @return TerminalSettings - * @throws ApiException if fails to make API call - */ - public TerminalSettings updateTerminalSettings(String companyId, TerminalSettings terminalSettings) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = terminalSettings.toJson(); - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/terminalSettings"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return TerminalSettings.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevelApi.java b/src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevelApi.java new file mode 100644 index 000000000..2275af74b --- /dev/null +++ b/src/main/java/com/adyen/service/management/TerminalSettingsCompanyLevelApi.java @@ -0,0 +1,185 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.Logo; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.TerminalSettings; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class TerminalSettingsCompanyLevelApi extends Service { + private final String baseURL; + + public TerminalSettingsCompanyLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get the terminal logo + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param model {@link String } The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (required) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo getTerminalLogo(String companyId, String model) throws ApiException, IOException { + return getTerminalLogo(companyId, model, null); + } + + /** + * Get the terminal logo + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param model {@link String } Query: The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo getTerminalLogo(String companyId, String model, 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 (model != null) { + queryParams.put("model", model); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/terminalLogos", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return Logo.fromJson(jsonResult); + } + + /** + * Get terminal settings + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings getTerminalSettings(String companyId) throws ApiException, IOException { + return getTerminalSettings(companyId, null); + } + + /** + * Get terminal settings + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings getTerminalSettings(String companyId, 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 = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/terminalSettings", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return TerminalSettings.fromJson(jsonResult); + } + + /** + * Update the terminal logo + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param model {@link String } The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (required) + * @param logo {@link Logo } (required) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo updateTerminalLogo(String companyId, String model, Logo logo) throws ApiException, IOException { + return updateTerminalLogo(companyId, model, logo, null); + } + + /** + * Update the terminal logo + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param logo {@link Logo } (required) + * @param model {@link String } Query: The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo updateTerminalLogo(String companyId, String model, Logo logo, 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 (model != null) { + queryParams.put("model", model); + } + + String requestBody = logo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/terminalLogos", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams, queryParams); + return Logo.fromJson(jsonResult); + } + + /** + * Update terminal settings + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param terminalSettings {@link TerminalSettings } (required) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings updateTerminalSettings(String companyId, TerminalSettings terminalSettings) throws ApiException, IOException { + return updateTerminalSettings(companyId, terminalSettings, null); + } + + /** + * Update terminal settings + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param terminalSettings {@link TerminalSettings } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings updateTerminalSettings(String companyId, TerminalSettings terminalSettings, 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 = terminalSettings.toJson(); + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/terminalSettings", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return TerminalSettings.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevel.java b/src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevel.java deleted file mode 100644 index d358529f1..000000000 --- a/src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevel.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.Logo; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.TerminalSettings; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class TerminalSettingsMerchantLevel extends ApiKeyAuthenticatedService { - public TerminalSettingsMerchantLevel(Client client) { - super(client); - } - - /** - * Get the terminal logo - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param queryParams (optional) - * model: The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (optional) - * @return Logo - * @throws ApiException if fails to make API call - */ - public Logo getTheTerminalLogo(String merchantId, Map queryParams) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/terminalLogos"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return Logo.fromJson(jsonResult); - } - - /** - * Get terminal settings - * - * @param merchantId The unique identifier of the merchant account. (required) - * @return TerminalSettings - * @throws ApiException if fails to make API call - */ - public TerminalSettings getTerminalSettings(String merchantId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/terminalSettings"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return TerminalSettings.fromJson(jsonResult); - } - - /** - * Update the terminal logo - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param logo (optional) - * @param queryParams (optional) - * model: The terminal model. Allowed values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (optional) - * @return Logo - * @throws ApiException if fails to make API call - */ - public Logo updateTheTerminalLogo(String merchantId, Logo logo, Map queryParams) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = logo.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/terminalLogos"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams, queryParams); - return Logo.fromJson(jsonResult); - } - - /** - * Update terminal settings - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param terminalSettings (optional) - * @return TerminalSettings - * @throws ApiException if fails to make API call - */ - public TerminalSettings updateTerminalSettings(String merchantId, TerminalSettings terminalSettings) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = terminalSettings.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/terminalSettings"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return TerminalSettings.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevelApi.java b/src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevelApi.java new file mode 100644 index 000000000..2967e78b6 --- /dev/null +++ b/src/main/java/com/adyen/service/management/TerminalSettingsMerchantLevelApi.java @@ -0,0 +1,185 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.Logo; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.TerminalSettings; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class TerminalSettingsMerchantLevelApi extends Service { + private final String baseURL; + + public TerminalSettingsMerchantLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get the terminal logo + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param model {@link String } The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (required) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo getTerminalLogo(String merchantId, String model) throws ApiException, IOException { + return getTerminalLogo(merchantId, model, null); + } + + /** + * Get the terminal logo + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param model {@link String } Query: The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo getTerminalLogo(String merchantId, String model, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + //Add query params + Map queryParams = new HashMap<>(); + if (model != null) { + queryParams.put("model", model); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/terminalLogos", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return Logo.fromJson(jsonResult); + } + + /** + * Get terminal settings + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings getTerminalSettings(String merchantId) throws ApiException, IOException { + return getTerminalSettings(merchantId, null); + } + + /** + * Get terminal settings + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings getTerminalSettings(String merchantId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/terminalSettings", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return TerminalSettings.fromJson(jsonResult); + } + + /** + * Update the terminal logo + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param model {@link String } The terminal model. Allowed values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (required) + * @param logo {@link Logo } (required) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo updateTerminalLogo(String merchantId, String model, Logo logo) throws ApiException, IOException { + return updateTerminalLogo(merchantId, model, logo, null); + } + + /** + * Update the terminal logo + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param logo {@link Logo } (required) + * @param model {@link String } Query: The terminal model. Allowed values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo updateTerminalLogo(String merchantId, String model, Logo logo, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + //Add query params + Map queryParams = new HashMap<>(); + if (model != null) { + queryParams.put("model", model); + } + + String requestBody = logo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/terminalLogos", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams, queryParams); + return Logo.fromJson(jsonResult); + } + + /** + * Update terminal settings + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param terminalSettings {@link TerminalSettings } (required) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings updateTerminalSettings(String merchantId, TerminalSettings terminalSettings) throws ApiException, IOException { + return updateTerminalSettings(merchantId, terminalSettings, null); + } + + /** + * Update terminal settings + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param terminalSettings {@link TerminalSettings } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings updateTerminalSettings(String merchantId, TerminalSettings terminalSettings, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + + String requestBody = terminalSettings.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/terminalSettings", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return TerminalSettings.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsStoreLevel.java b/src/main/java/com/adyen/service/management/TerminalSettingsStoreLevel.java deleted file mode 100644 index 02ffdfab7..000000000 --- a/src/main/java/com/adyen/service/management/TerminalSettingsStoreLevel.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.Logo; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.TerminalSettings; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class TerminalSettingsStoreLevel extends ApiKeyAuthenticatedService { - public TerminalSettingsStoreLevel(Client client) { - super(client); - } - - /** - * Get the terminal logo - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param reference The reference that identifies the store. (required) - * @param queryParams (optional) - * model: The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (optional) - * @return Logo - * @throws ApiException if fails to make API call - */ - public Logo getTheTerminalLogo(String merchantId, String reference, Map queryParams) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (reference == null) { - throw new ApiException("Missing the required parameter 'reference'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("reference", reference); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/stores/{reference}/terminalLogos"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return Logo.fromJson(jsonResult); - } - - /** - * Get terminal settings - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param reference The reference that identifies the store. (required) - * @return TerminalSettings - * @throws ApiException if fails to make API call - */ - public TerminalSettings getTerminalSettings(String merchantId, String reference) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (reference == null) { - throw new ApiException("Missing the required parameter 'reference'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("reference", reference); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/stores/{reference}/terminalSettings"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return TerminalSettings.fromJson(jsonResult); - } - - /** - * Get the terminal logo - * - * @param storeId The unique identifier of the store. (required) - * @param queryParams (optional) - * model: The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (optional) - * @return Logo - * @throws ApiException if fails to make API call - */ - public Logo getTheTerminalLogo(String storeId, Map queryParams) throws ApiException, IOException { - if (storeId == null) { - throw new ApiException("Missing the required parameter 'storeId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("storeId", storeId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/stores/{storeId}/terminalLogos"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return Logo.fromJson(jsonResult); - } - - /** - * Get terminal settings - * - * @param storeId The unique identifier of the store. (required) - * @return TerminalSettings - * @throws ApiException if fails to make API call - */ - public TerminalSettings getTerminalSettings(String storeId) throws ApiException, IOException { - if (storeId == null) { - throw new ApiException("Missing the required parameter 'storeId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("storeId", storeId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/stores/{storeId}/terminalSettings"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return TerminalSettings.fromJson(jsonResult); - } - - /** - * Update the terminal logo - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param reference The reference that identifies the store. (required) - * @param logo (optional) - * @param queryParams (optional) - * model: The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T (optional) - * @return Logo - * @throws ApiException if fails to make API call - */ - public Logo updateTheTerminalLogo(String merchantId, String reference, Logo logo, Map queryParams) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (reference == null) { - throw new ApiException("Missing the required parameter 'reference'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("reference", reference); - - String requestBody = logo.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/stores/{reference}/terminalLogos"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams, queryParams); - return Logo.fromJson(jsonResult); - } - - /** - * Update terminal settings - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param reference The reference that identifies the store. (required) - * @param terminalSettings (optional) - * @return TerminalSettings - * @throws ApiException if fails to make API call - */ - public TerminalSettings updateTerminalSettings(String merchantId, String reference, TerminalSettings terminalSettings) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (reference == null) { - throw new ApiException("Missing the required parameter 'reference'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("reference", reference); - - String requestBody = terminalSettings.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/stores/{reference}/terminalSettings"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return TerminalSettings.fromJson(jsonResult); - } - - /** - * Update the terminal logo - * - * @param storeId The unique identifier of the store. (required) - * @param logo (optional) - * @param queryParams (optional) - * model: The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (optional) - * @return Logo - * @throws ApiException if fails to make API call - */ - public Logo updateTheTerminalLogo(String storeId, Logo logo, Map queryParams) throws ApiException, IOException { - if (storeId == null) { - throw new ApiException("Missing the required parameter 'storeId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("storeId", storeId); - - String requestBody = logo.toJson(); - ManagementResource resource = new ManagementResource(this, "/stores/{storeId}/terminalLogos"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams, queryParams); - return Logo.fromJson(jsonResult); - } - - /** - * Update terminal settings - * - * @param storeId The unique identifier of the store. (required) - * @param terminalSettings (optional) - * @return TerminalSettings - * @throws ApiException if fails to make API call - */ - public TerminalSettings updateTerminalSettings(String storeId, TerminalSettings terminalSettings) throws ApiException, IOException { - if (storeId == null) { - throw new ApiException("Missing the required parameter 'storeId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("storeId", storeId); - - String requestBody = terminalSettings.toJson(); - ManagementResource resource = new ManagementResource(this, "/stores/{storeId}/terminalSettings"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return TerminalSettings.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsStoreLevelApi.java b/src/main/java/com/adyen/service/management/TerminalSettingsStoreLevelApi.java new file mode 100644 index 000000000..91edafe87 --- /dev/null +++ b/src/main/java/com/adyen/service/management/TerminalSettingsStoreLevelApi.java @@ -0,0 +1,359 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.Logo; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.TerminalSettings; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class TerminalSettingsStoreLevelApi extends Service { + private final String baseURL; + + public TerminalSettingsStoreLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get the terminal logo + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param reference {@link String } The reference that identifies the store. (required) + * @param model {@link String } The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (required) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo getTerminalLogo(String merchantId, String reference, String model) throws ApiException, IOException { + return getTerminalLogo(merchantId, reference, model, null); + } + + /** + * Get the terminal logo + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param reference {@link String } The reference that identifies the store. (required) + * @param model {@link String } Query: The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo getTerminalLogo(String merchantId, String reference, String model, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (reference == null) { + throw new IllegalArgumentException("Please provide the reference path parameter"); + } + pathParams.put("reference", reference); + //Add query params + Map queryParams = new HashMap<>(); + if (model != null) { + queryParams.put("model", model); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/stores/{reference}/terminalLogos", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return Logo.fromJson(jsonResult); + } + + /** + * Get terminal settings + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param reference {@link String } The reference that identifies the store. (required) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings getTerminalSettings(String merchantId, String reference) throws ApiException, IOException { + return getTerminalSettings(merchantId, reference, null); + } + + /** + * Get terminal settings + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param reference {@link String } The reference that identifies the store. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings getTerminalSettings(String merchantId, String reference, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (reference == null) { + throw new IllegalArgumentException("Please provide the reference path parameter"); + } + pathParams.put("reference", reference); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/stores/{reference}/terminalSettings", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return TerminalSettings.fromJson(jsonResult); + } + + /** + * Get the terminal logo + * + * @param storeId {@link String } The unique identifier of the store. (required) + * @param model {@link String } The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (required) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo getTerminalLogoByStoreId(String storeId, String model) throws ApiException, IOException { + return getTerminalLogoByStoreId(storeId, model, null); + } + + /** + * Get the terminal logo + * + * @param storeId {@link String } The unique identifier of the store. (required) + * @param model {@link String } Query: The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo getTerminalLogoByStoreId(String storeId, String model, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (storeId == null) { + throw new IllegalArgumentException("Please provide the storeId path parameter"); + } + pathParams.put("storeId", storeId); + //Add query params + Map queryParams = new HashMap<>(); + if (model != null) { + queryParams.put("model", model); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/stores/{storeId}/terminalLogos", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return Logo.fromJson(jsonResult); + } + + /** + * Get terminal settings + * + * @param storeId {@link String } The unique identifier of the store. (required) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings getTerminalSettingsByStoreId(String storeId) throws ApiException, IOException { + return getTerminalSettingsByStoreId(storeId, null); + } + + /** + * Get terminal settings + * + * @param storeId {@link String } The unique identifier of the store. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings getTerminalSettingsByStoreId(String storeId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (storeId == null) { + throw new IllegalArgumentException("Please provide the storeId path parameter"); + } + pathParams.put("storeId", storeId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/stores/{storeId}/terminalSettings", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return TerminalSettings.fromJson(jsonResult); + } + + /** + * Update the terminal logo + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param reference {@link String } The reference that identifies the store. (required) + * @param model {@link String } The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T (required) + * @param logo {@link Logo } (required) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo updateTerminalLogo(String merchantId, String reference, String model, Logo logo) throws ApiException, IOException { + return updateTerminalLogo(merchantId, reference, model, logo, null); + } + + /** + * Update the terminal logo + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param reference {@link String } The reference that identifies the store. (required) + * @param logo {@link Logo } (required) + * @param model {@link String } Query: The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo updateTerminalLogo(String merchantId, String reference, String model, Logo logo, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (reference == null) { + throw new IllegalArgumentException("Please provide the reference path parameter"); + } + pathParams.put("reference", reference); + //Add query params + Map queryParams = new HashMap<>(); + if (model != null) { + queryParams.put("model", model); + } + + String requestBody = logo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/stores/{reference}/terminalLogos", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams, queryParams); + return Logo.fromJson(jsonResult); + } + + /** + * Update terminal settings + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param reference {@link String } The reference that identifies the store. (required) + * @param terminalSettings {@link TerminalSettings } (required) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings updateTerminalSettings(String merchantId, String reference, TerminalSettings terminalSettings) throws ApiException, IOException { + return updateTerminalSettings(merchantId, reference, terminalSettings, null); + } + + /** + * Update terminal settings + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param reference {@link String } The reference that identifies the store. (required) + * @param terminalSettings {@link TerminalSettings } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings updateTerminalSettings(String merchantId, String reference, TerminalSettings terminalSettings, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (reference == null) { + throw new IllegalArgumentException("Please provide the reference path parameter"); + } + pathParams.put("reference", reference); + + String requestBody = terminalSettings.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/stores/{reference}/terminalSettings", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return TerminalSettings.fromJson(jsonResult); + } + + /** + * Update the terminal logo + * + * @param storeId {@link String } The unique identifier of the store. (required) + * @param model {@link String } The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (required) + * @param logo {@link Logo } (required) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo updateTerminalLogoByStoreId(String storeId, String model, Logo logo) throws ApiException, IOException { + return updateTerminalLogoByStoreId(storeId, model, logo, null); + } + + /** + * Update the terminal logo + * + * @param storeId {@link String } The unique identifier of the store. (required) + * @param logo {@link Logo } (required) + * @param model {@link String } Query: The terminal model. Possible values: E355, VX675WIFIBT, VX680, VX690, VX700, VX820, M400, MX925, P400Plus, UX300, UX410, V200cPlus, V240mPlus, V400cPlus, V400m, e280, e285, e285p, S1E, S1EL, S1F2, S1L, S1U, S7T. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo updateTerminalLogoByStoreId(String storeId, String model, Logo logo, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (storeId == null) { + throw new IllegalArgumentException("Please provide the storeId path parameter"); + } + pathParams.put("storeId", storeId); + //Add query params + Map queryParams = new HashMap<>(); + if (model != null) { + queryParams.put("model", model); + } + + String requestBody = logo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/stores/{storeId}/terminalLogos", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams, queryParams); + return Logo.fromJson(jsonResult); + } + + /** + * Update terminal settings + * + * @param storeId {@link String } The unique identifier of the store. (required) + * @param terminalSettings {@link TerminalSettings } (required) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings updateTerminalSettingsByStoreId(String storeId, TerminalSettings terminalSettings) throws ApiException, IOException { + return updateTerminalSettingsByStoreId(storeId, terminalSettings, null); + } + + /** + * Update terminal settings + * + * @param storeId {@link String } The unique identifier of the store. (required) + * @param terminalSettings {@link TerminalSettings } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings updateTerminalSettingsByStoreId(String storeId, TerminalSettings terminalSettings, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (storeId == null) { + throw new IllegalArgumentException("Please provide the storeId path parameter"); + } + pathParams.put("storeId", storeId); + + String requestBody = terminalSettings.toJson(); + Resource resource = new Resource(this, this.baseURL + "/stores/{storeId}/terminalSettings", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return TerminalSettings.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevel.java b/src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevel.java deleted file mode 100644 index 2b5164b81..000000000 --- a/src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevel.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.Logo; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.TerminalSettings; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class TerminalSettingsTerminalLevel extends ApiKeyAuthenticatedService { - public TerminalSettingsTerminalLevel(Client client) { - super(client); - } - - /** - * Get the terminal logo - * - * @param terminalId The unique identifier of the payment terminal. (required) - * @return Logo - * @throws ApiException if fails to make API call - */ - public Logo getTheTerminalLogo(String terminalId) throws ApiException, IOException { - if (terminalId == null) { - throw new ApiException("Missing the required parameter 'terminalId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("terminalId", terminalId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/terminals/{terminalId}/terminalLogos"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return Logo.fromJson(jsonResult); - } - - /** - * Get terminal settings - * - * @param terminalId The unique identifier of the payment terminal. (required) - * @return TerminalSettings - * @throws ApiException if fails to make API call - */ - public TerminalSettings getTerminalSettings(String terminalId) throws ApiException, IOException { - if (terminalId == null) { - throw new ApiException("Missing the required parameter 'terminalId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("terminalId", terminalId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/terminals/{terminalId}/terminalSettings"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return TerminalSettings.fromJson(jsonResult); - } - - /** - * Update the logo - * - * @param terminalId The unique identifier of the payment terminal. (required) - * @param logo (optional) - * @return Logo - * @throws ApiException if fails to make API call - */ - public Logo updateTheLogo(String terminalId, Logo logo) throws ApiException, IOException { - if (terminalId == null) { - throw new ApiException("Missing the required parameter 'terminalId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("terminalId", terminalId); - - String requestBody = logo.toJson(); - ManagementResource resource = new ManagementResource(this, "/terminals/{terminalId}/terminalLogos"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return Logo.fromJson(jsonResult); - } - - /** - * Update terminal settings - * - * @param terminalId The unique identifier of the payment terminal. (required) - * @param terminalSettings (optional) - * @return TerminalSettings - * @throws ApiException if fails to make API call - */ - public TerminalSettings updateTerminalSettings(String terminalId, TerminalSettings terminalSettings) throws ApiException, IOException { - if (terminalId == null) { - throw new ApiException("Missing the required parameter 'terminalId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("terminalId", terminalId); - - String requestBody = terminalSettings.toJson(); - ManagementResource resource = new ManagementResource(this, "/terminals/{terminalId}/terminalSettings"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return TerminalSettings.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevelApi.java b/src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevelApi.java new file mode 100644 index 000000000..06331f7ee --- /dev/null +++ b/src/main/java/com/adyen/service/management/TerminalSettingsTerminalLevelApi.java @@ -0,0 +1,171 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.Logo; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.TerminalSettings; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class TerminalSettingsTerminalLevelApi extends Service { + private final String baseURL; + + public TerminalSettingsTerminalLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get the terminal logo + * + * @param terminalId {@link String } The unique identifier of the payment terminal. (required) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo getTerminalLogo(String terminalId) throws ApiException, IOException { + return getTerminalLogo(terminalId, null); + } + + /** + * Get the terminal logo + * + * @param terminalId {@link String } The unique identifier of the payment terminal. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo getTerminalLogo(String terminalId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (terminalId == null) { + throw new IllegalArgumentException("Please provide the terminalId path parameter"); + } + pathParams.put("terminalId", terminalId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/terminals/{terminalId}/terminalLogos", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return Logo.fromJson(jsonResult); + } + + /** + * Get terminal settings + * + * @param terminalId {@link String } The unique identifier of the payment terminal. (required) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings getTerminalSettings(String terminalId) throws ApiException, IOException { + return getTerminalSettings(terminalId, null); + } + + /** + * Get terminal settings + * + * @param terminalId {@link String } The unique identifier of the payment terminal. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings getTerminalSettings(String terminalId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (terminalId == null) { + throw new IllegalArgumentException("Please provide the terminalId path parameter"); + } + pathParams.put("terminalId", terminalId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/terminals/{terminalId}/terminalSettings", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return TerminalSettings.fromJson(jsonResult); + } + + /** + * Update the logo + * + * @param terminalId {@link String } The unique identifier of the payment terminal. (required) + * @param logo {@link Logo } (required) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo updateLogo(String terminalId, Logo logo) throws ApiException, IOException { + return updateLogo(terminalId, logo, null); + } + + /** + * Update the logo + * + * @param terminalId {@link String } The unique identifier of the payment terminal. (required) + * @param logo {@link Logo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Logo } + * @throws ApiException if fails to make API call + */ + public Logo updateLogo(String terminalId, Logo logo, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (terminalId == null) { + throw new IllegalArgumentException("Please provide the terminalId path parameter"); + } + pathParams.put("terminalId", terminalId); + + String requestBody = logo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/terminals/{terminalId}/terminalLogos", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return Logo.fromJson(jsonResult); + } + + /** + * Update terminal settings + * + * @param terminalId {@link String } The unique identifier of the payment terminal. (required) + * @param terminalSettings {@link TerminalSettings } (required) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings updateTerminalSettings(String terminalId, TerminalSettings terminalSettings) throws ApiException, IOException { + return updateTerminalSettings(terminalId, terminalSettings, null); + } + + /** + * Update terminal settings + * + * @param terminalId {@link String } The unique identifier of the payment terminal. (required) + * @param terminalSettings {@link TerminalSettings } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TerminalSettings } + * @throws ApiException if fails to make API call + */ + public TerminalSettings updateTerminalSettings(String terminalId, TerminalSettings terminalSettings, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (terminalId == null) { + throw new IllegalArgumentException("Please provide the terminalId path parameter"); + } + pathParams.put("terminalId", terminalId); + + String requestBody = terminalSettings.toJson(); + Resource resource = new Resource(this, this.baseURL + "/terminals/{terminalId}/terminalSettings", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return TerminalSettings.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/TerminalsTerminalLevel.java b/src/main/java/com/adyen/service/management/TerminalsTerminalLevel.java deleted file mode 100644 index 7afd2e247..000000000 --- a/src/main/java/com/adyen/service/management/TerminalsTerminalLevel.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.ListTerminalsResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class TerminalsTerminalLevel extends ApiKeyAuthenticatedService { - public TerminalsTerminalLevel(Client client) { - super(client); - } - - /** - * Get a list of terminals - * - * @param queryParams (optional) - * searchQuery: Returns terminals with an ID that contains the specified string. If present, other query parameters are ignored. (optional) - * countries: Returns terminals located in the countries specified by their [two-letter country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). (optional) - * merchantIds: Returns terminals that belong to the merchant accounts specified by their unique merchant account ID. (optional) - * storeIds: Returns terminals that are assigned to the [stores](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/stores) specified by their unique store ID. (optional) - * brandModels: Returns terminals of the [models](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/companies/{companyId}/terminalModels) specified in the format *brand.model*. (optional) - * pageNumber: The number of the page to fetch. (optional) - * pageSize: The number of items to have on a page, maximum 100. The default is 20 items on a page. (optional) - * @return ListTerminalsResponse - * @throws ApiException if fails to make API call - */ - public ListTerminalsResponse listTerminals(Map queryParams) throws ApiException, IOException { - - Map pathParams = new HashMap<>(); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/terminals"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return ListTerminalsResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/TerminalsTerminalLevelApi.java b/src/main/java/com/adyen/service/management/TerminalsTerminalLevelApi.java new file mode 100644 index 000000000..08f54a74b --- /dev/null +++ b/src/main/java/com/adyen/service/management/TerminalsTerminalLevelApi.java @@ -0,0 +1,89 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.ListTerminalsResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class TerminalsTerminalLevelApi extends Service { + private final String baseURL; + + public TerminalsTerminalLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of terminals + * + * @return {@link ListTerminalsResponse } + * @throws ApiException if fails to make API call + */ + public ListTerminalsResponse listTerminals() throws ApiException, IOException { + return listTerminals(null, null, null, null, null, null, null, null); + } + + /** + * Get a list of terminals + * + * @param searchQuery {@link String } Query: Returns terminals with an ID that contains the specified string. If present, other query parameters are ignored. (optional) + * @param countries {@link String } Query: Returns terminals located in the countries specified by their [two-letter country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). (optional) + * @param merchantIds {@link String } Query: Returns terminals that belong to the merchant accounts specified by their unique merchant account ID. (optional) + * @param storeIds {@link String } Query: Returns terminals that are assigned to the [stores](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/stores) specified by their unique store ID. (optional) + * @param brandModels {@link String } Query: Returns terminals of the [models](https://docs.adyen.com/api-explorer/#/ManagementService/latest/get/companies/{companyId}/terminalModels) specified in the format *brand.model*. (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 20 items on a page. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ListTerminalsResponse } + * @throws ApiException if fails to make API call + */ + public ListTerminalsResponse listTerminals(String searchQuery, String countries, String merchantIds, String storeIds, String brandModels, Integer pageNumber, Integer pageSize, RequestOptions requestOptions) throws ApiException, IOException { + //Add query params + Map queryParams = new HashMap<>(); + if (searchQuery != null) { + queryParams.put("searchQuery", searchQuery); + } + if (countries != null) { + queryParams.put("countries", countries); + } + if (merchantIds != null) { + queryParams.put("merchantIds", merchantIds); + } + if (storeIds != null) { + queryParams.put("storeIds", storeIds); + } + if (brandModels != null) { + queryParams.put("brandModels", brandModels); + } + 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 + "/terminals", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, null, queryParams); + return ListTerminalsResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/UsersCompanyLevel.java b/src/main/java/com/adyen/service/management/UsersCompanyLevel.java deleted file mode 100644 index 9efd57c60..000000000 --- a/src/main/java/com/adyen/service/management/UsersCompanyLevel.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.CompanyUser; -import com.adyen.model.management.CreateCompanyUserRequest; -import com.adyen.model.management.CreateCompanyUserResponse; -import com.adyen.model.management.ListCompanyUsersResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.UpdateCompanyUserRequest; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class UsersCompanyLevel extends ApiKeyAuthenticatedService { - public UsersCompanyLevel(Client client) { - super(client); - } - - /** - * Get a list of users - * - * @param companyId The unique identifier of the company account. (required) - * @param queryParams (optional) - * pageNumber: The number of the page to return. (optional) - * pageSize: The number of items to have on a page. Maximum value is **100**. The default is **10** items on a page. (optional) - * @return ListCompanyUsersResponse - * @throws ApiException if fails to make API call - */ - public ListCompanyUsersResponse listUsers(String companyId, Map queryParams) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/users"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return ListCompanyUsersResponse.fromJson(jsonResult); - } - - /** - * Get user details - * - * @param companyId The unique identifier of the company account. (required) - * @param userId The unique identifier of the user. (required) - * @return CompanyUser - * @throws ApiException if fails to make API call - */ - public CompanyUser getUserDetails(String companyId, String userId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (userId == null) { - throw new ApiException("Missing the required parameter 'userId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("userId", userId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/users/{userId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return CompanyUser.fromJson(jsonResult); - } - - /** - * Update user details - * - * @param companyId The unique identifier of the company account. (required) - * @param userId The unique identifier of the user. (required) - * @param updateCompanyUserRequest (optional) - * @return CompanyUser - * @throws ApiException if fails to make API call - */ - public CompanyUser updateUserDetails(String companyId, String userId, UpdateCompanyUserRequest updateCompanyUserRequest) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (userId == null) { - throw new ApiException("Missing the required parameter 'userId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("userId", userId); - - String requestBody = updateCompanyUserRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/users/{userId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return CompanyUser.fromJson(jsonResult); - } - - /** - * Create a new user - * - * @param companyId The unique identifier of the company account. (required) - * @param createCompanyUserRequest (optional) - * @return CreateCompanyUserResponse - * @throws ApiException if fails to make API call - */ - public CreateCompanyUserResponse createNewUser(String companyId, CreateCompanyUserRequest createCompanyUserRequest) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = createCompanyUserRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/users"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return CreateCompanyUserResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/UsersCompanyLevelApi.java b/src/main/java/com/adyen/service/management/UsersCompanyLevelApi.java new file mode 100644 index 000000000..6a09a265b --- /dev/null +++ b/src/main/java/com/adyen/service/management/UsersCompanyLevelApi.java @@ -0,0 +1,200 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.CompanyUser; +import com.adyen.model.management.CreateCompanyUserRequest; +import com.adyen.model.management.CreateCompanyUserResponse; +import com.adyen.model.management.ListCompanyUsersResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.UpdateCompanyUserRequest; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class UsersCompanyLevelApi extends Service { + private final String baseURL; + + public UsersCompanyLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of users + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @return {@link ListCompanyUsersResponse } + * @throws ApiException if fails to make API call + */ + public ListCompanyUsersResponse listUsers(String companyId) throws ApiException, IOException { + return listUsers(companyId, null, null, null, null); + } + + /** + * Get a list of users + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param pageNumber {@link Integer } Query: The number of the page to return. (optional) + * @param pageSize {@link Integer } Query: The number of items to have on a page. Maximum value is **100**. The default is **10** items on a page. (optional) + * @param username {@link String } Query: The partial or complete username to select all users that match. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ListCompanyUsersResponse } + * @throws ApiException if fails to make API call + */ + public ListCompanyUsersResponse listUsers(String companyId, Integer pageNumber, Integer pageSize, String username, 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 (pageNumber != null) { + queryParams.put("pageNumber", pageNumber.toString()); + } + if (pageSize != null) { + queryParams.put("pageSize", pageSize.toString()); + } + if (username != null) { + queryParams.put("username", username); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/users", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return ListCompanyUsersResponse.fromJson(jsonResult); + } + + /** + * Get user details + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param userId {@link String } The unique identifier of the user. (required) + * @return {@link CompanyUser } + * @throws ApiException if fails to make API call + */ + public CompanyUser getUserDetails(String companyId, String userId) throws ApiException, IOException { + return getUserDetails(companyId, userId, null); + } + + /** + * Get user details + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param userId {@link String } The unique identifier of the user. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CompanyUser } + * @throws ApiException if fails to make API call + */ + public CompanyUser getUserDetails(String companyId, String userId, 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 (userId == null) { + throw new IllegalArgumentException("Please provide the userId path parameter"); + } + pathParams.put("userId", userId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/users/{userId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return CompanyUser.fromJson(jsonResult); + } + + /** + * Update user details + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param userId {@link String } The unique identifier of the user. (required) + * @param updateCompanyUserRequest {@link UpdateCompanyUserRequest } (required) + * @return {@link CompanyUser } + * @throws ApiException if fails to make API call + */ + public CompanyUser updateUserDetails(String companyId, String userId, UpdateCompanyUserRequest updateCompanyUserRequest) throws ApiException, IOException { + return updateUserDetails(companyId, userId, updateCompanyUserRequest, null); + } + + /** + * Update user details + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param userId {@link String } The unique identifier of the user. (required) + * @param updateCompanyUserRequest {@link UpdateCompanyUserRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CompanyUser } + * @throws ApiException if fails to make API call + */ + public CompanyUser updateUserDetails(String companyId, String userId, UpdateCompanyUserRequest updateCompanyUserRequest, 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 (userId == null) { + throw new IllegalArgumentException("Please provide the userId path parameter"); + } + pathParams.put("userId", userId); + + String requestBody = updateCompanyUserRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/users/{userId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return CompanyUser.fromJson(jsonResult); + } + + /** + * Create a new user + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param createCompanyUserRequest {@link CreateCompanyUserRequest } (required) + * @return {@link CreateCompanyUserResponse } + * @throws ApiException if fails to make API call + */ + public CreateCompanyUserResponse createNewUser(String companyId, CreateCompanyUserRequest createCompanyUserRequest) throws ApiException, IOException { + return createNewUser(companyId, createCompanyUserRequest, null); + } + + /** + * Create a new user + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param createCompanyUserRequest {@link CreateCompanyUserRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CreateCompanyUserResponse } + * @throws ApiException if fails to make API call + */ + public CreateCompanyUserResponse createNewUser(String companyId, CreateCompanyUserRequest createCompanyUserRequest, 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 = createCompanyUserRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/users", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return CreateCompanyUserResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/UsersMerchantLevel.java b/src/main/java/com/adyen/service/management/UsersMerchantLevel.java deleted file mode 100644 index 104a0bb2e..000000000 --- a/src/main/java/com/adyen/service/management/UsersMerchantLevel.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.CreateMerchantUserRequest; -import com.adyen.model.management.CreateUserResponse; -import com.adyen.model.management.ListMerchantUsersResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.UpdateMerchantUserRequest; -import com.adyen.model.management.User; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class UsersMerchantLevel extends ApiKeyAuthenticatedService { - public UsersMerchantLevel(Client client) { - super(client); - } - - /** - * Get a list of users - * - * @param merchantId Unique identifier of the merchant. (required) - * @param queryParams (optional) - * pageNumber: The number of the page to fetch. (optional) - * pageSize: The number of items to have on a page. Maximum value is **100**. The default is **10** items on a page. (optional) - * @return ListMerchantUsersResponse - * @throws ApiException if fails to make API call - */ - public ListMerchantUsersResponse listUsers(String merchantId, Map queryParams) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/users"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return ListMerchantUsersResponse.fromJson(jsonResult); - } - - /** - * Get user details - * - * @param merchantId Unique identifier of the merchant. (required) - * @param userId Unique identifier of the user. (required) - * @return User - * @throws ApiException if fails to make API call - */ - public User getUserDetails(String merchantId, String userId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (userId == null) { - throw new ApiException("Missing the required parameter 'userId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("userId", userId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/users/{userId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return User.fromJson(jsonResult); - } - - /** - * Update a user - * - * @param merchantId Unique identifier of the merchant. (required) - * @param userId Unique identifier of the user. (required) - * @param updateMerchantUserRequest (optional) - * @return User - * @throws ApiException if fails to make API call - */ - public User updateUser(String merchantId, String userId, UpdateMerchantUserRequest updateMerchantUserRequest) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (userId == null) { - throw new ApiException("Missing the required parameter 'userId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("userId", userId); - - String requestBody = updateMerchantUserRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/users/{userId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return User.fromJson(jsonResult); - } - - /** - * Create a new user - * - * @param merchantId Unique identifier of the merchant. (required) - * @param createMerchantUserRequest (optional) - * @return CreateUserResponse - * @throws ApiException if fails to make API call - */ - public CreateUserResponse createNewUser(String merchantId, CreateMerchantUserRequest createMerchantUserRequest) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = createMerchantUserRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/users"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return CreateUserResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/UsersMerchantLevelApi.java b/src/main/java/com/adyen/service/management/UsersMerchantLevelApi.java new file mode 100644 index 000000000..33fe2c2d5 --- /dev/null +++ b/src/main/java/com/adyen/service/management/UsersMerchantLevelApi.java @@ -0,0 +1,200 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.CreateMerchantUserRequest; +import com.adyen.model.management.CreateUserResponse; +import com.adyen.model.management.ListMerchantUsersResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.UpdateMerchantUserRequest; +import com.adyen.model.management.User; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class UsersMerchantLevelApi extends Service { + private final String baseURL; + + public UsersMerchantLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of users + * + * @param merchantId {@link String } Unique identifier of the merchant. (required) + * @return {@link ListMerchantUsersResponse } + * @throws ApiException if fails to make API call + */ + public ListMerchantUsersResponse listUsers(String merchantId) throws ApiException, IOException { + return listUsers(merchantId, null, null, null, null); + } + + /** + * Get a list of users + * + * @param merchantId {@link String } Unique identifier of the merchant. (required) + * @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 value is **100**. The default is **10** items on a page. (optional) + * @param username {@link String } Query: The partial or complete username to select all users that match. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ListMerchantUsersResponse } + * @throws ApiException if fails to make API call + */ + public ListMerchantUsersResponse listUsers(String merchantId, Integer pageNumber, Integer pageSize, String username, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + //Add query params + Map queryParams = new HashMap<>(); + if (pageNumber != null) { + queryParams.put("pageNumber", pageNumber.toString()); + } + if (pageSize != null) { + queryParams.put("pageSize", pageSize.toString()); + } + if (username != null) { + queryParams.put("username", username); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/users", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return ListMerchantUsersResponse.fromJson(jsonResult); + } + + /** + * Get user details + * + * @param merchantId {@link String } Unique identifier of the merchant. (required) + * @param userId {@link String } Unique identifier of the user. (required) + * @return {@link User } + * @throws ApiException if fails to make API call + */ + public User getUserDetails(String merchantId, String userId) throws ApiException, IOException { + return getUserDetails(merchantId, userId, null); + } + + /** + * Get user details + * + * @param merchantId {@link String } Unique identifier of the merchant. (required) + * @param userId {@link String } Unique identifier of the user. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link User } + * @throws ApiException if fails to make API call + */ + public User getUserDetails(String merchantId, String userId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (userId == null) { + throw new IllegalArgumentException("Please provide the userId path parameter"); + } + pathParams.put("userId", userId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/users/{userId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return User.fromJson(jsonResult); + } + + /** + * Update a user + * + * @param merchantId {@link String } Unique identifier of the merchant. (required) + * @param userId {@link String } Unique identifier of the user. (required) + * @param updateMerchantUserRequest {@link UpdateMerchantUserRequest } (required) + * @return {@link User } + * @throws ApiException if fails to make API call + */ + public User updateUser(String merchantId, String userId, UpdateMerchantUserRequest updateMerchantUserRequest) throws ApiException, IOException { + return updateUser(merchantId, userId, updateMerchantUserRequest, null); + } + + /** + * Update a user + * + * @param merchantId {@link String } Unique identifier of the merchant. (required) + * @param userId {@link String } Unique identifier of the user. (required) + * @param updateMerchantUserRequest {@link UpdateMerchantUserRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link User } + * @throws ApiException if fails to make API call + */ + public User updateUser(String merchantId, String userId, UpdateMerchantUserRequest updateMerchantUserRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (userId == null) { + throw new IllegalArgumentException("Please provide the userId path parameter"); + } + pathParams.put("userId", userId); + + String requestBody = updateMerchantUserRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/users/{userId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return User.fromJson(jsonResult); + } + + /** + * Create a new user + * + * @param merchantId {@link String } Unique identifier of the merchant. (required) + * @param createMerchantUserRequest {@link CreateMerchantUserRequest } (required) + * @return {@link CreateUserResponse } + * @throws ApiException if fails to make API call + */ + public CreateUserResponse createNewUser(String merchantId, CreateMerchantUserRequest createMerchantUserRequest) throws ApiException, IOException { + return createNewUser(merchantId, createMerchantUserRequest, null); + } + + /** + * Create a new user + * + * @param merchantId {@link String } Unique identifier of the merchant. (required) + * @param createMerchantUserRequest {@link CreateMerchantUserRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CreateUserResponse } + * @throws ApiException if fails to make API call + */ + public CreateUserResponse createNewUser(String merchantId, CreateMerchantUserRequest createMerchantUserRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + + String requestBody = createMerchantUserRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/users", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return CreateUserResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/WebhooksCompanyLevel.java b/src/main/java/com/adyen/service/management/WebhooksCompanyLevel.java deleted file mode 100644 index 77c02136a..000000000 --- a/src/main/java/com/adyen/service/management/WebhooksCompanyLevel.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.CreateCompanyWebhookRequest; -import com.adyen.model.management.GenerateHmacKeyResponse; -import com.adyen.model.management.ListWebhooksResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.TestCompanyWebhookRequest; -import com.adyen.model.management.TestWebhookResponse; -import com.adyen.model.management.UpdateCompanyWebhookRequest; -import com.adyen.model.management.Webhook; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class WebhooksCompanyLevel extends ApiKeyAuthenticatedService { - public WebhooksCompanyLevel(Client client) { - super(client); - } - - /** - * Remove a webhook - * - * @param companyId The unique identifier of the company account. (required) - * @param webhookId Unique identifier of the webhook configuration. (required) - * @throws ApiException if fails to make API call - */ - public void removeWebhook(String companyId, String webhookId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (webhookId == null) { - throw new ApiException("Missing the required parameter 'webhookId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("webhookId", webhookId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/webhooks/{webhookId}"); - resource.request(requestBody, null, ApiConstants.HttpMethod.DELETE, pathParams); - } - - /** - * List all webhooks - * - * @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). (required) - * @param queryParams (optional) - * pageNumber: The number of the page to fetch. (optional) - * pageSize: The number of items to have on a page, maximum 100. The default is 10 items on a page. (optional) - * @return ListWebhooksResponse - * @throws ApiException if fails to make API call - */ - public ListWebhooksResponse listAllWebhooks(String companyId, Map queryParams) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/webhooks"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return ListWebhooksResponse.fromJson(jsonResult); - } - - /** - * Get a webhook - * - * @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). (required) - * @param webhookId Unique identifier of the webhook configuration. (required) - * @return Webhook - * @throws ApiException if fails to make API call - */ - public Webhook getWebhook(String companyId, String webhookId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (webhookId == null) { - throw new ApiException("Missing the required parameter 'webhookId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("webhookId", webhookId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/webhooks/{webhookId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return Webhook.fromJson(jsonResult); - } - - /** - * Update a webhook - * - * @param companyId The unique identifier of the company account. (required) - * @param webhookId Unique identifier of the webhook configuration. (required) - * @param updateCompanyWebhookRequest (optional) - * @return Webhook - * @throws ApiException if fails to make API call - */ - public Webhook updateWebhook(String companyId, String webhookId, UpdateCompanyWebhookRequest updateCompanyWebhookRequest) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (webhookId == null) { - throw new ApiException("Missing the required parameter 'webhookId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("webhookId", webhookId); - - String requestBody = updateCompanyWebhookRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/webhooks/{webhookId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return Webhook.fromJson(jsonResult); - } - - /** - * Set up a webhook - * - * @param companyId Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). (required) - * @param createCompanyWebhookRequest (optional) - * @return Webhook - * @throws ApiException if fails to make API call - */ - public Webhook setUpWebhook(String companyId, CreateCompanyWebhookRequest createCompanyWebhookRequest) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - - String requestBody = createCompanyWebhookRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/webhooks"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return Webhook.fromJson(jsonResult); - } - - /** - * Generate an HMAC key - * - * @param companyId The unique identifier of the company account. (required) - * @param webhookId Unique identifier of the webhook configuration. (required) - * @return GenerateHmacKeyResponse - * @throws ApiException if fails to make API call - */ - public GenerateHmacKeyResponse generateHmacKey(String companyId, String webhookId) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (webhookId == null) { - throw new ApiException("Missing the required parameter 'webhookId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("webhookId", webhookId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/webhooks/{webhookId}/generateHmac"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return GenerateHmacKeyResponse.fromJson(jsonResult); - } - - /** - * Test a webhook - * - * @param companyId The unique identifier of the company account. (required) - * @param webhookId Unique identifier of the webhook configuration. (required) - * @param testCompanyWebhookRequest (optional) - * @return TestWebhookResponse - * @throws ApiException if fails to make API call - */ - public TestWebhookResponse testWebhook(String companyId, String webhookId, TestCompanyWebhookRequest testCompanyWebhookRequest) throws ApiException, IOException { - if (companyId == null) { - throw new ApiException("Missing the required parameter 'companyId'", 400); - } - if (webhookId == null) { - throw new ApiException("Missing the required parameter 'webhookId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("companyId", companyId); - pathParams.put("webhookId", webhookId); - - String requestBody = testCompanyWebhookRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/companies/{companyId}/webhooks/{webhookId}/test"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return TestWebhookResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/WebhooksCompanyLevelApi.java b/src/main/java/com/adyen/service/management/WebhooksCompanyLevelApi.java new file mode 100644 index 000000000..87384c46d --- /dev/null +++ b/src/main/java/com/adyen/service/management/WebhooksCompanyLevelApi.java @@ -0,0 +1,314 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.CreateCompanyWebhookRequest; +import com.adyen.model.management.GenerateHmacKeyResponse; +import com.adyen.model.management.ListWebhooksResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.TestCompanyWebhookRequest; +import com.adyen.model.management.TestWebhookResponse; +import com.adyen.model.management.UpdateCompanyWebhookRequest; +import com.adyen.model.management.Webhook; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class WebhooksCompanyLevelApi extends Service { + private final String baseURL; + + public WebhooksCompanyLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Remove a webhook + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @throws ApiException if fails to make API call + */ + public void removeWebhook(String companyId, String webhookId) throws ApiException, IOException { + removeWebhook(companyId, webhookId, null); + } + + /** + * Remove a webhook + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @throws ApiException if fails to make API call + */ + public void removeWebhook(String companyId, String webhookId, 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 (webhookId == null) { + throw new IllegalArgumentException("Please provide the webhookId path parameter"); + } + pathParams.put("webhookId", webhookId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/webhooks/{webhookId}", null); + resource.request(requestBody, null, ApiConstants.HttpMethod.DELETE, pathParams); + } + + /** + * List all webhooks + * + * @param companyId {@link String } Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). (required) + * @return {@link ListWebhooksResponse } + * @throws ApiException if fails to make API call + */ + public ListWebhooksResponse listAllWebhooks(String companyId) throws ApiException, IOException { + return listAllWebhooks(companyId, null, null, null); + } + + /** + * List all webhooks + * + * @param companyId {@link String } Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). (required) + * @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) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ListWebhooksResponse } + * @throws ApiException if fails to make API call + */ + public ListWebhooksResponse listAllWebhooks(String companyId, 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); + //Add query params + Map queryParams = new HashMap<>(); + 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}/webhooks", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return ListWebhooksResponse.fromJson(jsonResult); + } + + /** + * Get a webhook + * + * @param companyId {@link String } Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @return {@link Webhook } + * @throws ApiException if fails to make API call + */ + public Webhook getWebhook(String companyId, String webhookId) throws ApiException, IOException { + return getWebhook(companyId, webhookId, null); + } + + /** + * Get a webhook + * + * @param companyId {@link String } Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Webhook } + * @throws ApiException if fails to make API call + */ + public Webhook getWebhook(String companyId, String webhookId, 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 (webhookId == null) { + throw new IllegalArgumentException("Please provide the webhookId path parameter"); + } + pathParams.put("webhookId", webhookId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/webhooks/{webhookId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return Webhook.fromJson(jsonResult); + } + + /** + * Update a webhook + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @param updateCompanyWebhookRequest {@link UpdateCompanyWebhookRequest } (required) + * @return {@link Webhook } + * @throws ApiException if fails to make API call + */ + public Webhook updateWebhook(String companyId, String webhookId, UpdateCompanyWebhookRequest updateCompanyWebhookRequest) throws ApiException, IOException { + return updateWebhook(companyId, webhookId, updateCompanyWebhookRequest, null); + } + + /** + * Update a webhook + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @param updateCompanyWebhookRequest {@link UpdateCompanyWebhookRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Webhook } + * @throws ApiException if fails to make API call + */ + public Webhook updateWebhook(String companyId, String webhookId, UpdateCompanyWebhookRequest updateCompanyWebhookRequest, 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 (webhookId == null) { + throw new IllegalArgumentException("Please provide the webhookId path parameter"); + } + pathParams.put("webhookId", webhookId); + + String requestBody = updateCompanyWebhookRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/webhooks/{webhookId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return Webhook.fromJson(jsonResult); + } + + /** + * Set up a webhook + * + * @param companyId {@link String } Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). (required) + * @param createCompanyWebhookRequest {@link CreateCompanyWebhookRequest } (required) + * @return {@link Webhook } + * @throws ApiException if fails to make API call + */ + public Webhook setUpWebhook(String companyId, CreateCompanyWebhookRequest createCompanyWebhookRequest) throws ApiException, IOException { + return setUpWebhook(companyId, createCompanyWebhookRequest, null); + } + + /** + * Set up a webhook + * + * @param companyId {@link String } Unique identifier of the [company account](https://docs.adyen.com/account/account-structure#company-account). (required) + * @param createCompanyWebhookRequest {@link CreateCompanyWebhookRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Webhook } + * @throws ApiException if fails to make API call + */ + public Webhook setUpWebhook(String companyId, CreateCompanyWebhookRequest createCompanyWebhookRequest, 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 = createCompanyWebhookRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/webhooks", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return Webhook.fromJson(jsonResult); + } + + /** + * Generate an HMAC key + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @return {@link GenerateHmacKeyResponse } + * @throws ApiException if fails to make API call + */ + public GenerateHmacKeyResponse generateHmacKey(String companyId, String webhookId) throws ApiException, IOException { + return generateHmacKey(companyId, webhookId, null); + } + + /** + * Generate an HMAC key + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GenerateHmacKeyResponse } + * @throws ApiException if fails to make API call + */ + public GenerateHmacKeyResponse generateHmacKey(String companyId, String webhookId, 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 (webhookId == null) { + throw new IllegalArgumentException("Please provide the webhookId path parameter"); + } + pathParams.put("webhookId", webhookId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/webhooks/{webhookId}/generateHmac", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return GenerateHmacKeyResponse.fromJson(jsonResult); + } + + /** + * Test a webhook + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @param testCompanyWebhookRequest {@link TestCompanyWebhookRequest } (required) + * @return {@link TestWebhookResponse } + * @throws ApiException if fails to make API call + */ + public TestWebhookResponse testWebhook(String companyId, String webhookId, TestCompanyWebhookRequest testCompanyWebhookRequest) throws ApiException, IOException { + return testWebhook(companyId, webhookId, testCompanyWebhookRequest, null); + } + + /** + * Test a webhook + * + * @param companyId {@link String } The unique identifier of the company account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @param testCompanyWebhookRequest {@link TestCompanyWebhookRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TestWebhookResponse } + * @throws ApiException if fails to make API call + */ + public TestWebhookResponse testWebhook(String companyId, String webhookId, TestCompanyWebhookRequest testCompanyWebhookRequest, 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 (webhookId == null) { + throw new IllegalArgumentException("Please provide the webhookId path parameter"); + } + pathParams.put("webhookId", webhookId); + + String requestBody = testCompanyWebhookRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/companies/{companyId}/webhooks/{webhookId}/test", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return TestWebhookResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/management/WebhooksMerchantLevel.java b/src/main/java/com/adyen/service/management/WebhooksMerchantLevel.java deleted file mode 100644 index a98cb34c1..000000000 --- a/src/main/java/com/adyen/service/management/WebhooksMerchantLevel.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Management API - * - * The version of the OpenAPI document: 1 - * Contact: developer-experience@adyen.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.adyen.service.management; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.constants.ApiConstants; -import com.adyen.model.management.JSON; -import com.adyen.model.management.CreateMerchantWebhookRequest; -import com.adyen.model.management.GenerateHmacKeyResponse; -import com.adyen.model.management.ListWebhooksResponse; -import com.adyen.model.management.RestServiceError; -import com.adyen.model.management.TestWebhookRequest; -import com.adyen.model.management.TestWebhookResponse; -import com.adyen.model.management.UpdateMerchantWebhookRequest; -import com.adyen.model.management.Webhook; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.ManagementResource; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -public class WebhooksMerchantLevel extends ApiKeyAuthenticatedService { - public WebhooksMerchantLevel(Client client) { - super(client); - } - - /** - * Remove a webhook - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param webhookId Unique identifier of the webhook configuration. (required) - * @throws ApiException if fails to make API call - */ - public void removeWebhook(String merchantId, String webhookId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (webhookId == null) { - throw new ApiException("Missing the required parameter 'webhookId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("webhookId", webhookId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/webhooks/{webhookId}"); - resource.request(requestBody, null, ApiConstants.HttpMethod.DELETE, pathParams); - } - - /** - * List all webhooks - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param queryParams (optional) - * pageNumber: The number of the page to fetch. (optional) - * pageSize: The number of items to have on a page, maximum 100. The default is 10 items on a page. (optional) - * @return ListWebhooksResponse - * @throws ApiException if fails to make API call - */ - public ListWebhooksResponse listAllWebhooks(String merchantId, Map queryParams) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/webhooks"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams, queryParams); - return ListWebhooksResponse.fromJson(jsonResult); - } - - /** - * Get a webhook - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param webhookId Unique identifier of the webhook configuration. (required) - * @return Webhook - * @throws ApiException if fails to make API call - */ - public Webhook getWebhook(String merchantId, String webhookId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (webhookId == null) { - throw new ApiException("Missing the required parameter 'webhookId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("webhookId", webhookId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/webhooks/{webhookId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.GET, pathParams); - return Webhook.fromJson(jsonResult); - } - - /** - * Update a webhook - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param webhookId Unique identifier of the webhook configuration. (required) - * @param updateMerchantWebhookRequest (optional) - * @return Webhook - * @throws ApiException if fails to make API call - */ - public Webhook updateWebhook(String merchantId, String webhookId, UpdateMerchantWebhookRequest updateMerchantWebhookRequest) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (webhookId == null) { - throw new ApiException("Missing the required parameter 'webhookId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("webhookId", webhookId); - - String requestBody = updateMerchantWebhookRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/webhooks/{webhookId}"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.PATCH, pathParams); - return Webhook.fromJson(jsonResult); - } - - /** - * Set up a webhook - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param createMerchantWebhookRequest (optional) - * @return Webhook - * @throws ApiException if fails to make API call - */ - public Webhook setUpWebhook(String merchantId, CreateMerchantWebhookRequest createMerchantWebhookRequest) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - - String requestBody = createMerchantWebhookRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/webhooks"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return Webhook.fromJson(jsonResult); - } - - /** - * Generate an HMAC key - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param webhookId (required) - * @return GenerateHmacKeyResponse - * @throws ApiException if fails to make API call - */ - public GenerateHmacKeyResponse generateHmacKey(String merchantId, String webhookId) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (webhookId == null) { - throw new ApiException("Missing the required parameter 'webhookId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("webhookId", webhookId); - - String requestBody = null; - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/webhooks/{webhookId}/generateHmac"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return GenerateHmacKeyResponse.fromJson(jsonResult); - } - - /** - * Test a webhook - * - * @param merchantId The unique identifier of the merchant account. (required) - * @param webhookId Unique identifier of the webhook configuration. (required) - * @param testWebhookRequest (optional) - * @return TestWebhookResponse - * @throws ApiException if fails to make API call - */ - public TestWebhookResponse testWebhook(String merchantId, String webhookId, TestWebhookRequest testWebhookRequest) throws ApiException, IOException { - if (merchantId == null) { - throw new ApiException("Missing the required parameter 'merchantId'", 400); - } - if (webhookId == null) { - throw new ApiException("Missing the required parameter 'webhookId'", 400); - } - - Map pathParams = new HashMap<>(); - pathParams.put("merchantId", merchantId); - pathParams.put("webhookId", webhookId); - - String requestBody = testWebhookRequest.toJson(); - ManagementResource resource = new ManagementResource(this, "/merchants/{merchantId}/webhooks/{webhookId}/test"); - String jsonResult = resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); - return TestWebhookResponse.fromJson(jsonResult); - } - -} diff --git a/src/main/java/com/adyen/service/management/WebhooksMerchantLevelApi.java b/src/main/java/com/adyen/service/management/WebhooksMerchantLevelApi.java new file mode 100644 index 000000000..58d36d0f4 --- /dev/null +++ b/src/main/java/com/adyen/service/management/WebhooksMerchantLevelApi.java @@ -0,0 +1,314 @@ +/* + * Management API + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.management; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.management.CreateMerchantWebhookRequest; +import com.adyen.model.management.GenerateHmacKeyResponse; +import com.adyen.model.management.ListWebhooksResponse; +import com.adyen.model.management.RestServiceError; +import com.adyen.model.management.TestWebhookRequest; +import com.adyen.model.management.TestWebhookResponse; +import com.adyen.model.management.UpdateMerchantWebhookRequest; +import com.adyen.model.management.Webhook; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class WebhooksMerchantLevelApi extends Service { + private final String baseURL; + + public WebhooksMerchantLevelApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://management-test.adyen.com/v1"); + } + + /** + * Remove a webhook + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @throws ApiException if fails to make API call + */ + public void removeWebhook(String merchantId, String webhookId) throws ApiException, IOException { + removeWebhook(merchantId, webhookId, null); + } + + /** + * Remove a webhook + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @throws ApiException if fails to make API call + */ + public void removeWebhook(String merchantId, String webhookId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (webhookId == null) { + throw new IllegalArgumentException("Please provide the webhookId path parameter"); + } + pathParams.put("webhookId", webhookId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/webhooks/{webhookId}", null); + resource.request(requestBody, null, ApiConstants.HttpMethod.DELETE, pathParams); + } + + /** + * List all webhooks + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @return {@link ListWebhooksResponse } + * @throws ApiException if fails to make API call + */ + public ListWebhooksResponse listAllWebhooks(String merchantId) throws ApiException, IOException { + return listAllWebhooks(merchantId, null, null, null); + } + + /** + * List all webhooks + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @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) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ListWebhooksResponse } + * @throws ApiException if fails to make API call + */ + public ListWebhooksResponse listAllWebhooks(String merchantId, Integer pageNumber, Integer pageSize, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + //Add query params + Map queryParams = new HashMap<>(); + 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 + "/merchants/{merchantId}/webhooks", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return ListWebhooksResponse.fromJson(jsonResult); + } + + /** + * Get a webhook + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @return {@link Webhook } + * @throws ApiException if fails to make API call + */ + public Webhook getWebhook(String merchantId, String webhookId) throws ApiException, IOException { + return getWebhook(merchantId, webhookId, null); + } + + /** + * Get a webhook + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Webhook } + * @throws ApiException if fails to make API call + */ + public Webhook getWebhook(String merchantId, String webhookId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (webhookId == null) { + throw new IllegalArgumentException("Please provide the webhookId path parameter"); + } + pathParams.put("webhookId", webhookId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/webhooks/{webhookId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return Webhook.fromJson(jsonResult); + } + + /** + * Update a webhook + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @param updateMerchantWebhookRequest {@link UpdateMerchantWebhookRequest } (required) + * @return {@link Webhook } + * @throws ApiException if fails to make API call + */ + public Webhook updateWebhook(String merchantId, String webhookId, UpdateMerchantWebhookRequest updateMerchantWebhookRequest) throws ApiException, IOException { + return updateWebhook(merchantId, webhookId, updateMerchantWebhookRequest, null); + } + + /** + * Update a webhook + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @param updateMerchantWebhookRequest {@link UpdateMerchantWebhookRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Webhook } + * @throws ApiException if fails to make API call + */ + public Webhook updateWebhook(String merchantId, String webhookId, UpdateMerchantWebhookRequest updateMerchantWebhookRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (webhookId == null) { + throw new IllegalArgumentException("Please provide the webhookId path parameter"); + } + pathParams.put("webhookId", webhookId); + + String requestBody = updateMerchantWebhookRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/webhooks/{webhookId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return Webhook.fromJson(jsonResult); + } + + /** + * Set up a webhook + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param createMerchantWebhookRequest {@link CreateMerchantWebhookRequest } (required) + * @return {@link Webhook } + * @throws ApiException if fails to make API call + */ + public Webhook setUpWebhook(String merchantId, CreateMerchantWebhookRequest createMerchantWebhookRequest) throws ApiException, IOException { + return setUpWebhook(merchantId, createMerchantWebhookRequest, null); + } + + /** + * Set up a webhook + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param createMerchantWebhookRequest {@link CreateMerchantWebhookRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link Webhook } + * @throws ApiException if fails to make API call + */ + public Webhook setUpWebhook(String merchantId, CreateMerchantWebhookRequest createMerchantWebhookRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + + String requestBody = createMerchantWebhookRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/webhooks", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return Webhook.fromJson(jsonResult); + } + + /** + * Generate an HMAC key + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param webhookId {@link String } (required) + * @return {@link GenerateHmacKeyResponse } + * @throws ApiException if fails to make API call + */ + public GenerateHmacKeyResponse generateHmacKey(String merchantId, String webhookId) throws ApiException, IOException { + return generateHmacKey(merchantId, webhookId, null); + } + + /** + * Generate an HMAC key + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param webhookId {@link String } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GenerateHmacKeyResponse } + * @throws ApiException if fails to make API call + */ + public GenerateHmacKeyResponse generateHmacKey(String merchantId, String webhookId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (webhookId == null) { + throw new IllegalArgumentException("Please provide the webhookId path parameter"); + } + pathParams.put("webhookId", webhookId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/webhooks/{webhookId}/generateHmac", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return GenerateHmacKeyResponse.fromJson(jsonResult); + } + + /** + * Test a webhook + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @param testWebhookRequest {@link TestWebhookRequest } (required) + * @return {@link TestWebhookResponse } + * @throws ApiException if fails to make API call + */ + public TestWebhookResponse testWebhook(String merchantId, String webhookId, TestWebhookRequest testWebhookRequest) throws ApiException, IOException { + return testWebhook(merchantId, webhookId, testWebhookRequest, null); + } + + /** + * Test a webhook + * + * @param merchantId {@link String } The unique identifier of the merchant account. (required) + * @param webhookId {@link String } Unique identifier of the webhook configuration. (required) + * @param testWebhookRequest {@link TestWebhookRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TestWebhookResponse } + * @throws ApiException if fails to make API call + */ + public TestWebhookResponse testWebhook(String merchantId, String webhookId, TestWebhookRequest testWebhookRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (merchantId == null) { + throw new IllegalArgumentException("Please provide the merchantId path parameter"); + } + pathParams.put("merchantId", merchantId); + if (webhookId == null) { + throw new IllegalArgumentException("Please provide the webhookId path parameter"); + } + pathParams.put("webhookId", webhookId); + + String requestBody = testWebhookRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/merchants/{merchantId}/webhooks/{webhookId}/test", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return TestWebhookResponse.fromJson(jsonResult); + } +} diff --git a/src/test/java/com/adyen/ErrorHandlingTest.java b/src/test/java/com/adyen/ErrorHandlingTest.java index f8087348d..9fae08d00 100644 --- a/src/test/java/com/adyen/ErrorHandlingTest.java +++ b/src/test/java/com/adyen/ErrorHandlingTest.java @@ -4,7 +4,7 @@ import com.adyen.model.management.CreateAllowedOriginRequest; import com.adyen.service.checkout.PaymentLinksApi; import com.adyen.service.exception.ApiException; -import com.adyen.service.management.MyApiCredential; +import com.adyen.service.management.MyApiCredentialApi; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; @@ -16,7 +16,7 @@ public class ErrorHandlingTest extends BaseTest{ @Ignore("Integration test") public void addAllowedOriginFail() throws IOException, ApiException { Client client = new Client(System.getenv("API_KEY"), Environment.TEST); - MyApiCredential service = new MyApiCredential(client); + MyApiCredentialApi service = new MyApiCredentialApi(client); CreateAllowedOriginRequest createAllowedOriginRequest = new CreateAllowedOriginRequest(); createAllowedOriginRequest.setDomain("https://google.com"); diff --git a/src/test/java/com/adyen/ManagementTest.java b/src/test/java/com/adyen/ManagementTest.java index 7217e1a9c..150f8814d 100644 --- a/src/test/java/com/adyen/ManagementTest.java +++ b/src/test/java/com/adyen/ManagementTest.java @@ -20,9 +20,9 @@ public class ManagementTest extends BaseTest { @Test public void listMerchantAccounts() throws IOException, ApiException { Client client = createMockClientFromFile("mocks/management/list-merchants.json"); - AccountMerchantLevel service = new AccountMerchantLevel(client); + AccountMerchantLevelApi service = new AccountMerchantLevelApi(client); - ListMerchantResponse merchants = service.listMerchantAccounts(null); + ListMerchantResponse merchants = service.listMerchantAccounts(); assertEquals(10, merchants.getData().size()); assertEquals("Amsterdam", merchants.getData().get(0).getMerchantCity()); @@ -33,15 +33,15 @@ public void listMerchantAccountsPaginated() throws IOException, ApiException, HT Client client = createMockClientFromFile("mocks/management/list-merchants.json"); client.setEnvironment(Environment.TEST, "junit"); Map queryParams = Collections.singletonMap("pageSize", "25"); - AccountMerchantLevel service = new AccountMerchantLevel(client); + AccountMerchantLevelApi service = new AccountMerchantLevelApi(client); - service.listMerchantAccounts(queryParams); + service.listMerchantAccounts(null, 25, null); verify(client.getHttpClient()).request( "https://management-test.adyen.com/v1/merchants", null, client.getConfig(), - true, + false, null, ApiConstants.HttpMethod.GET, queryParams @@ -51,9 +51,9 @@ public void listMerchantAccountsPaginated() throws IOException, ApiException, HT @Test public void listCompanies() throws IOException, ApiException { Client client = createMockClientFromFile("mocks/management/list-companies.json"); - AccountCompanyLevel service = new AccountCompanyLevel(client); + AccountCompanyLevelApi service = new AccountCompanyLevelApi(client); - ListCompanyResponse merchants = service.listCompanyAccounts(null); + ListCompanyResponse merchants = service.listCompanyAccounts(); assertEquals(1, merchants.getData().size()); assertEquals("YOUR_COMPANY_NAME", merchants.getData().get(0).getName()); @@ -62,7 +62,7 @@ public void listCompanies() throws IOException, ApiException { @Test public void updateTerminalSettings() throws IOException, ApiException, HTTPClientException { Client client = createMockClientFromFile("mocks/management/terminal-settings.json"); - TerminalSettingsTerminalLevel service = new TerminalSettingsTerminalLevel(client); + TerminalSettingsTerminalLevelApi service = new TerminalSettingsTerminalLevelApi(client); TerminalSettings request = new TerminalSettings(); request.setReceiptPrinting(new ReceiptPrinting().shopperApproved(true)); @@ -72,10 +72,10 @@ public void updateTerminalSettings() throws IOException, ApiException, HTTPClien assertNotNull(response.getReceiptPrinting().getShopperApproved()); assertTrue(response.getReceiptPrinting().getShopperApproved()); verify(client.getHttpClient()).request( - "nullv1/terminals/123ABC/terminalSettings", + "https://management-test.adyen.com/v1/terminals/123ABC/terminalSettings", "{\"receiptPrinting\":{\"shopperApproved\":true}}", client.getConfig(), - true, + false, null, ApiConstants.HttpMethod.PATCH, null @@ -85,18 +85,18 @@ public void updateTerminalSettings() throws IOException, ApiException, HTTPClien @Test public void createStore() throws IOException, ApiException, HTTPClientException { Client client = createMockClientFromFile("mocks/management/store.json"); - AccountStoreLevel service = new AccountStoreLevel(client); + AccountStoreLevelApi service = new AccountStoreLevelApi(client); StoreCreationRequest request = new StoreCreationRequest(); request.setDescription("City centre store"); - Store store = service.createStore("YOUR_MERCHANT_ACCOUNT_ID", request); + Store store = service.createStoreByMerchantId("YOUR_MERCHANT_ACCOUNT_ID", request); assertEquals("YOUR_STORE_ID", store.getId()); verify(client.getHttpClient()).request( - "nullv1/merchants/YOUR_MERCHANT_ACCOUNT_ID/stores", + "https://management-test.adyen.com/v1/merchants/YOUR_MERCHANT_ACCOUNT_ID/stores", "{\"description\":\"City centre store\"}", client.getConfig(), - true, + false, null, ApiConstants.HttpMethod.POST, null @@ -106,15 +106,15 @@ public void createStore() throws IOException, ApiException, HTTPClientException @Test public void removeAllowedOrigin() throws IOException, ApiException, HTTPClientException { Client client = createMockClientFromFile("mocks/management/store.json"); - MyApiCredential service = new MyApiCredential(client); + MyApiCredentialApi service = new MyApiCredentialApi(client); - service.removeAllowedOrigin("DOEI"); + service.removeAllowedOrigin("ID"); verify(client.getHttpClient()).request( - "nullv1/me/allowedOrigins/DOEI", + "https://management-test.adyen.com/v1/me/allowedOrigins/ID", null, client.getConfig(), - true, + false, null, ApiConstants.HttpMethod.DELETE, null @@ -125,7 +125,7 @@ public void removeAllowedOrigin() throws IOException, ApiException, HTTPClientEx @Ignore("Integration test") public void me() throws IOException, ApiException { Client client = new Client(System.getenv("API_KEY"), Environment.TEST); - MyApiCredential service = new MyApiCredential(client); + MyApiCredentialApi service = new MyApiCredentialApi(client); MeApiCredential me = service.getApiCredentialDetails(); diff --git a/src/test/java/com/adyen/RecurringTest.java b/src/test/java/com/adyen/RecurringTest.java index 6e664e290..b18f8d20b 100644 --- a/src/test/java/com/adyen/RecurringTest.java +++ b/src/test/java/com/adyen/RecurringTest.java @@ -7,7 +7,7 @@ package com.adyen; import com.adyen.model.recurring.*; -import com.adyen.service.Recurring; +import com.adyen.service.RecurringApi; import com.adyen.service.exception.ApiException; import org.junit.Test; @@ -78,7 +78,7 @@ private NotifyShopperRequest createNotifyShopperRequest() { @Test public void testListRecurringDetails() throws Exception { Client client = createMockClientFromFile("mocks/recurring/listRecurringDetails-success.json"); - Recurring recurring = new Recurring(client); + RecurringApi recurring = new RecurringApi(client); RecurringDetailsRequest request = createRecurringDetailsRequest(); @@ -96,7 +96,7 @@ public void testListRecurringDetails() throws Exception { @Test public void testDisable() throws Exception { Client client = createMockClientFromFile("mocks/recurring/disable-success.json"); - Recurring recurring = new Recurring(client); + RecurringApi recurring = new RecurringApi(client); DisableRequest request = createDisableRequest(); @@ -107,7 +107,7 @@ public void testDisable() throws Exception { @Test public void testDisable803() throws IOException { Client client = createMockClientForErrors(422, "mocks/recurring/disable-error-803.json"); - Recurring recurring = new Recurring(client); + RecurringApi recurring = new RecurringApi(client); DisableRequest request = createDisableRequest(); @@ -123,7 +123,7 @@ public void testDisable803() throws IOException { @Test public void testScheduleAccountUpdater() throws Exception { Client client = createMockClientFromFile("mocks/recurring/scheduleAccountUpdater-success.json"); - Recurring recurring = new Recurring(client); + RecurringApi recurring = new RecurringApi(client); ScheduleAccountUpdaterRequest request = createScheduleAccountUpdaterRequest(); @@ -137,7 +137,7 @@ public void testScheduleAccountUpdater() throws Exception { @Test public void testScheduleAccountUpdater130() throws IOException { Client client = createMockClientForErrors(422, "mocks/recurring/scheduleAccountUpdater-error-130.json"); - Recurring recurring = new Recurring(client); + RecurringApi recurring = new RecurringApi(client); ScheduleAccountUpdaterRequest request = createScheduleAccountUpdaterRequest(); @@ -153,7 +153,7 @@ public void testScheduleAccountUpdater130() throws IOException { @Test public void testNotifyShopper() throws IOException, ApiException { Client client = createMockClientFromFile("mocks/recurring/notifyShopper-success.json"); - Recurring recurring = new Recurring(client); + RecurringApi recurring = new RecurringApi(client); NotifyShopperRequest request = createNotifyShopperRequest(); @@ -170,7 +170,7 @@ public void testNotifyShopper() throws IOException, ApiException { @Test public void testCreatePermit() throws IOException, ApiException { Client client = createMockClientFromFile("mocks/recurring/createPermit-success.json"); - Recurring recurring = new Recurring(client); + RecurringApi recurring = new RecurringApi(client); CreatePermitRequest createPermitRequest = new CreatePermitRequest(); createPermitRequest.setMerchantAccount("merchantAccount"); @@ -192,7 +192,7 @@ public void testCreatePermit() throws IOException, ApiException { @Test public void testDisablePermit() throws IOException, ApiException { Client client = createMockClientFromFile("mocks/recurring/disablePermit-success.json"); - Recurring recurring = new Recurring(client); + RecurringApi recurring = new RecurringApi(client); DisablePermitRequest disablePermitRequest = new DisablePermitRequest(); disablePermitRequest.setMerchantAccount("merchantAccount"); From e5a11d5e74e18e5814b1687a647a7f439e109cb7 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Mon, 8 May 2023 15:47:56 +0200 Subject: [PATCH 28/32] [ITT-498] Regenerated Payment/BinLookup/PosTerminalManagement (#1009) * Regen BinLookup * Regen PosTerminalManagement * regenerated payment api * fix tests after conflict --- Makefile | 10 +- .../model/payment/AbstractOpenApiSchema.java | 145 ++ .../{payments => payment}/AccountInfo.java | 5 +- .../model/{payments => payment}/AcctInfo.java | 5 +- .../AdditionalData3DSecure.java | 5 +- .../AdditionalDataAirline.java | 5 +- .../AdditionalDataCarRental.java | 5 +- .../AdditionalDataCommon.java | 5 +- .../AdditionalDataLevel23.java | 5 +- .../AdditionalDataLodging.java | 5 +- .../AdditionalDataModifications.java | 5 +- .../AdditionalDataOpenInvoice.java | 5 +- .../AdditionalDataOpi.java | 5 +- .../AdditionalDataRatepay.java | 5 +- .../AdditionalDataRetry.java | 5 +- .../AdditionalDataRisk.java | 5 +- .../AdditionalDataRiskStandalone.java | 5 +- .../AdditionalDataSubMerchant.java | 5 +- .../AdditionalDataTemporaryServices.java | 5 +- .../AdditionalDataWallets.java | 5 +- .../model/{payments => payment}/Address.java | 5 +- .../AdjustAuthorisationRequest.java | 13 +- .../model/{payments => payment}/Amount.java | 5 +- .../ApplicationInfo.java | 13 +- .../AuthenticationResultRequest.java | 5 +- .../AuthenticationResultResponse.java | 9 +- .../{payments => payment}/BankAccount.java | 5 +- .../{payments => payment}/BrowserInfo.java | 5 +- .../CancelOrRefundRequest.java | 9 +- .../{payments => payment}/CancelRequest.java | 11 +- .../{payments => payment}/CaptureRequest.java | 13 +- .../model/{payments => payment}/Card.java | 5 +- .../{payments => payment}/CommonField.java | 5 +- .../DeviceRenderOptions.java | 5 +- .../DonationRequest.java | 9 +- .../ExternalPlatform.java | 5 +- .../{payments => payment}/ForexQuote.java | 7 +- .../FraudCheckResult.java | 5 +- .../FraudCheckResultWrapper.java | 7 +- .../{payments => payment}/FraudResult.java | 7 +- .../FundDestination.java | 13 +- .../{payments => payment}/FundSource.java | 11 +- .../{payments => payment}/Installments.java | 5 +- .../model/{payments => payment}/JSON.java | 159 +- .../model/{payments => payment}/Mandate.java | 5 +- .../{payments => payment}/MerchantDevice.java | 5 +- .../MerchantRiskIndicator.java | 7 +- .../ModificationResult.java | 5 +- .../model/{payments => payment}/Name.java | 5 +- .../{payments => payment}/PaymentRequest.java | 43 +- .../PaymentRequest3d.java | 29 +- .../PaymentRequest3ds2.java | 31 +- .../{payments => payment}/PaymentResult.java | 9 +- .../model/{payments => payment}/Phone.java | 5 +- .../PlatformChargebackLogic.java | 5 +- .../{payments => payment}/Recurring.java | 5 +- .../{payments => payment}/RefundRequest.java | 13 +- .../ResponseAdditionalData3DSecure.java | 5 +- .../ResponseAdditionalDataBillingAddress.java | 5 +- .../ResponseAdditionalDataCard.java | 5 +- .../ResponseAdditionalDataCommon.java | 5 +- .../ResponseAdditionalDataInstallments.java | 5 +- .../ResponseAdditionalDataNetworkTokens.java | 5 +- .../ResponseAdditionalDataOpi.java | 5 +- .../ResponseAdditionalDataSepa.java | 5 +- .../{payments => payment}/SDKEphemPubKey.java | 5 +- .../{payments => payment}/ServiceError.java | 5 +- .../ShopperInteractionDevice.java | 5 +- .../model/{payments => payment}/Split.java | 7 +- .../{payments => payment}/SplitAmount.java | 5 +- .../{payments => payment}/SubMerchant.java | 5 +- .../TechnicalCancelRequest.java | 13 +- .../{payments => payment}/ThreeDS1Result.java | 5 +- .../ThreeDS2RequestData.java | 17 +- .../{payments => payment}/ThreeDS2Result.java | 5 +- .../ThreeDS2ResultRequest.java | 5 +- .../ThreeDS2ResultResponse.java | 7 +- .../ThreeDSRequestorAuthenticationInfo.java | 5 +- ...reeDSRequestorPriorAuthenticationInfo.java | 5 +- .../ThreeDSecureData.java | 5 +- .../VoidPendingRefundRequest.java | 13 +- .../AbstractOpenApiSchema.java | 7 +- .../model/posterminalmanagement/Address.java | 488 ++++-- .../AssignTerminalsRequest.java | 452 +++-- .../AssignTerminalsResponse.java | 257 ++- .../FindTerminalRequest.java | 253 ++- .../FindTerminalResponse.java | 444 +++-- .../GetStoresUnderAccountRequest.java | 303 +++- .../GetStoresUnderAccountResponse.java | 273 ++- .../GetTerminalDetailsRequest.java | 253 ++- .../GetTerminalDetailsResponse.java | 1503 ++++++++++------- .../GetTerminalsUnderAccountRequest.java | 343 ++-- .../GetTerminalsUnderAccountResponse.java | 377 +++-- .../model/posterminalmanagement/JSON.java | 413 +++++ .../MerchantAccount.java | 447 +++-- .../posterminalmanagement/ServiceError.java | 337 ++++ .../model/posterminalmanagement/Store.java | 509 ++++-- .../java/com/adyen/service/BinLookup.java | 36 - .../java/com/adyen/service/BinLookupApi.java | 92 + src/main/java/com/adyen/service/Payment.java | 308 ---- .../java/com/adyen/service/PaymentApi.java | 402 +++++ .../adyen/service/PosTerminalManagement.java | 140 -- .../service/PosTerminalManagementApi.java | 179 ++ src/test/java/com/adyen/BaseTest.java | 28 +- src/test/java/com/adyen/BinLookupTest.java | 20 +- src/test/java/com/adyen/MarketPayTest.java | 16 +- src/test/java/com/adyen/PaymentTest.java | 82 +- .../com/adyen/PosTerminalManagementTest.java | 13 +- 108 files changed, 6058 insertions(+), 2817 deletions(-) create mode 100644 src/main/java/com/adyen/model/payment/AbstractOpenApiSchema.java rename src/main/java/com/adyen/model/{payments => payment}/AccountInfo.java (95%) rename src/main/java/com/adyen/model/{payments => payment}/AcctInfo.java (95%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalData3DSecure.java (91%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalDataAirline.java (96%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalDataCarRental.java (96%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalDataCommon.java (95%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalDataLevel23.java (95%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalDataLodging.java (95%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalDataModifications.java (81%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalDataOpenInvoice.java (95%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalDataOpi.java (80%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalDataRatepay.java (90%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalDataRetry.java (87%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalDataRisk.java (96%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalDataRiskStandalone.java (93%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalDataSubMerchant.java (93%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalDataTemporaryServices.java (92%) rename src/main/java/com/adyen/model/{payments => payment}/AdditionalDataWallets.java (88%) rename src/main/java/com/adyen/model/{payments => payment}/Address.java (88%) rename src/main/java/com/adyen/model/{payments => payment}/AdjustAuthorisationRequest.java (91%) rename src/main/java/com/adyen/model/{payments => payment}/Amount.java (81%) rename src/main/java/com/adyen/model/{payments => payment}/ApplicationInfo.java (86%) rename src/main/java/com/adyen/model/{payments => payment}/AuthenticationResultRequest.java (83%) rename src/main/java/com/adyen/model/{payments => payment}/AuthenticationResultResponse.java (80%) rename src/main/java/com/adyen/model/{payments => payment}/BankAccount.java (90%) rename src/main/java/com/adyen/model/{payments => payment}/BrowserInfo.java (89%) rename src/main/java/com/adyen/model/{payments => payment}/CancelOrRefundRequest.java (90%) rename src/main/java/com/adyen/model/{payments => payment}/CancelRequest.java (91%) rename src/main/java/com/adyen/model/{payments => payment}/CaptureRequest.java (91%) rename src/main/java/com/adyen/model/{payments => payment}/Card.java (89%) rename src/main/java/com/adyen/model/{payments => payment}/CommonField.java (80%) rename src/main/java/com/adyen/model/{payments => payment}/DeviceRenderOptions.java (86%) rename src/main/java/com/adyen/model/{payments => payment}/DonationRequest.java (88%) rename src/main/java/com/adyen/model/{payments => payment}/ExternalPlatform.java (82%) rename src/main/java/com/adyen/model/{payments => payment}/ForexQuote.java (90%) rename src/main/java/com/adyen/model/{payments => payment}/FraudCheckResult.java (82%) rename src/main/java/com/adyen/model/{payments => payment}/FraudCheckResultWrapper.java (78%) rename src/main/java/com/adyen/model/{payments => payment}/FraudResult.java (81%) rename src/main/java/com/adyen/model/{payments => payment}/FundDestination.java (89%) rename src/main/java/com/adyen/model/{payments => payment}/FundSource.java (85%) rename src/main/java/com/adyen/model/{payments => payment}/Installments.java (84%) rename src/main/java/com/adyen/model/{payments => payment}/JSON.java (74%) rename src/main/java/com/adyen/model/{payments => payment}/Mandate.java (92%) rename src/main/java/com/adyen/model/{payments => payment}/MerchantDevice.java (82%) rename src/main/java/com/adyen/model/{payments => payment}/MerchantRiskIndicator.java (93%) rename src/main/java/com/adyen/model/{payments => payment}/ModificationResult.java (86%) rename src/main/java/com/adyen/model/{payments => payment}/Name.java (81%) rename src/main/java/com/adyen/model/{payments => payment}/PaymentRequest.java (97%) rename src/main/java/com/adyen/model/{payments => payment}/PaymentRequest3d.java (97%) rename src/main/java/com/adyen/model/{payments => payment}/PaymentRequest3ds2.java (97%) rename src/main/java/com/adyen/model/{payments => payment}/PaymentResult.java (93%) rename src/main/java/com/adyen/model/{payments => payment}/Phone.java (80%) rename src/main/java/com/adyen/model/{payments => payment}/PlatformChargebackLogic.java (85%) rename src/main/java/com/adyen/model/{payments => payment}/Recurring.java (90%) rename src/main/java/com/adyen/model/{payments => payment}/RefundRequest.java (91%) rename src/main/java/com/adyen/model/{payments => payment}/ResponseAdditionalData3DSecure.java (87%) rename src/main/java/com/adyen/model/{payments => payment}/ResponseAdditionalDataBillingAddress.java (89%) rename src/main/java/com/adyen/model/{payments => payment}/ResponseAdditionalDataCard.java (90%) rename src/main/java/com/adyen/model/{payments => payment}/ResponseAdditionalDataCommon.java (98%) rename src/main/java/com/adyen/model/{payments => payment}/ResponseAdditionalDataInstallments.java (94%) rename src/main/java/com/adyen/model/{payments => payment}/ResponseAdditionalDataNetworkTokens.java (85%) rename src/main/java/com/adyen/model/{payments => payment}/ResponseAdditionalDataOpi.java (80%) rename src/main/java/com/adyen/model/{payments => payment}/ResponseAdditionalDataSepa.java (86%) rename src/main/java/com/adyen/model/{payments => payment}/SDKEphemPubKey.java (83%) rename src/main/java/com/adyen/model/{payments => payment}/ServiceError.java (86%) rename src/main/java/com/adyen/model/{payments => payment}/ShopperInteractionDevice.java (83%) rename src/main/java/com/adyen/model/{payments => payment}/Split.java (88%) rename src/main/java/com/adyen/model/{payments => payment}/SplitAmount.java (81%) rename src/main/java/com/adyen/model/{payments => payment}/SubMerchant.java (86%) rename src/main/java/com/adyen/model/{payments => payment}/TechnicalCancelRequest.java (91%) rename src/main/java/com/adyen/model/{payments => payment}/ThreeDS1Result.java (87%) rename src/main/java/com/adyen/model/{payments => payment}/ThreeDS2RequestData.java (97%) rename src/main/java/com/adyen/model/{payments => payment}/ThreeDS2Result.java (94%) rename src/main/java/com/adyen/model/{payments => payment}/ThreeDS2ResultRequest.java (82%) rename src/main/java/com/adyen/model/{payments => payment}/ThreeDS2ResultResponse.java (78%) rename src/main/java/com/adyen/model/{payments => payment}/ThreeDSRequestorAuthenticationInfo.java (88%) rename src/main/java/com/adyen/model/{payments => payment}/ThreeDSRequestorPriorAuthenticationInfo.java (89%) rename src/main/java/com/adyen/model/{payments => payment}/ThreeDSecureData.java (93%) rename src/main/java/com/adyen/model/{payments => payment}/VoidPendingRefundRequest.java (91%) rename src/main/java/com/adyen/model/{payments => posterminalmanagement}/AbstractOpenApiSchema.java (69%) mode change 100755 => 100644 src/main/java/com/adyen/model/posterminalmanagement/Address.java mode change 100755 => 100644 src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsRequest.java mode change 100755 => 100644 src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsResponse.java mode change 100755 => 100644 src/main/java/com/adyen/model/posterminalmanagement/FindTerminalRequest.java mode change 100755 => 100644 src/main/java/com/adyen/model/posterminalmanagement/FindTerminalResponse.java mode change 100755 => 100644 src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountRequest.java mode change 100755 => 100644 src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountResponse.java mode change 100755 => 100644 src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsRequest.java mode change 100755 => 100644 src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsResponse.java mode change 100755 => 100644 src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountRequest.java mode change 100755 => 100644 src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountResponse.java create mode 100644 src/main/java/com/adyen/model/posterminalmanagement/JSON.java mode change 100755 => 100644 src/main/java/com/adyen/model/posterminalmanagement/MerchantAccount.java create mode 100644 src/main/java/com/adyen/model/posterminalmanagement/ServiceError.java mode change 100755 => 100644 src/main/java/com/adyen/model/posterminalmanagement/Store.java delete mode 100644 src/main/java/com/adyen/service/BinLookup.java create mode 100644 src/main/java/com/adyen/service/BinLookupApi.java delete mode 100644 src/main/java/com/adyen/service/Payment.java create mode 100644 src/main/java/com/adyen/service/PaymentApi.java delete mode 100644 src/main/java/com/adyen/service/PosTerminalManagement.java create mode 100644 src/main/java/com/adyen/service/PosTerminalManagementApi.java diff --git a/Makefile b/Makefile index d08677101..44fcaa486 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ openapi-generator-cli:=java -jar $(openapi-generator-jar) generator:=java library:=okhttp-gson -modelGen:=balanceplatform binlookup checkout legalentitymanagement management payments payout recurring transfers +modelGen:=balanceplatform binlookup checkout legalentitymanagement management payment payout recurring transfers models:=src/main/java/com/adyen/model output:=target/out @@ -23,7 +23,8 @@ storedvalue: spec=StoredValueService-v46 storedvalue: smallServiceName=StoredValueApi posterminalmanagement: spec=TfmAPIService-v1 posterminalmanagement: smallServiceName=PosTerminalManagementApi -payments: spec=PaymentService-v68 +payment: spec=PaymentService-v68 +payment: smallServiceName=PaymentApi recurring: spec=RecurringService-v68 recurring: smallServiceName=RecurringApi payout: spec=PayoutService-v68 @@ -61,8 +62,8 @@ $(services): target/spec $(openapi-generator-jar) mv $(output)/$(models)/JSON.java $(models)/$@ # Full service + models automation -bigServices:=balanceplatform checkout storedValue payments payout management legalentitymanagement transfers -singleFileServices:=balancecontrol binlookup dataprotection storedvalue posterminalmanagement recurring +bigServices:=balanceplatform checkout storedValue payout management legalentitymanagement transfers +singleFileServices:=balancecontrol binlookup dataprotection storedvalue posterminalmanagement recurring payment services: $(bigServices) $(singleFileServices) @@ -92,6 +93,7 @@ $(bigServices): target/spec $(openapi-generator-jar) mv $(output)/src/main/java/com/adyen/service/$@ src/main/java/com/adyen/service/$@ $(singleFileServices): target/spec $(openapi-generator-jar) + cat <<< "$$(jq 'del(.paths[][].tags)' target/spec/json/$(spec).json)" > target/spec/json/$(spec).json rm -rf $(models)/$@ $(output) rm -rf src/main/java/com/adyen/service/$@ $(output) $(openapi-generator-cli) generate \ diff --git a/src/main/java/com/adyen/model/payment/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/payment/AbstractOpenApiSchema.java new file mode 100644 index 000000000..6dc0baa88 --- /dev/null +++ b/src/main/java/com/adyen/model/payment/AbstractOpenApiSchema.java @@ -0,0 +1,145 @@ +/* + * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. + * + * The version of the OpenAPI document: 68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.payment; + +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import jakarta.ws.rs.core.GenericType; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/src/main/java/com/adyen/model/payments/AccountInfo.java b/src/main/java/com/adyen/model/payment/AccountInfo.java similarity index 95% rename from src/main/java/com/adyen/model/payments/AccountInfo.java rename to src/main/java/com/adyen/model/payment/AccountInfo.java index 772a22723..e218f8bea 100644 --- a/src/main/java/com/adyen/model/payments/AccountInfo.java +++ b/src/main/java/com/adyen/model/payment/AccountInfo.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -42,7 +43,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AccountInfo diff --git a/src/main/java/com/adyen/model/payments/AcctInfo.java b/src/main/java/com/adyen/model/payment/AcctInfo.java similarity index 95% rename from src/main/java/com/adyen/model/payments/AcctInfo.java rename to src/main/java/com/adyen/model/payment/AcctInfo.java index c02362893..d9be4a8ec 100644 --- a/src/main/java/com/adyen/model/payments/AcctInfo.java +++ b/src/main/java/com/adyen/model/payment/AcctInfo.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AcctInfo diff --git a/src/main/java/com/adyen/model/payments/AdditionalData3DSecure.java b/src/main/java/com/adyen/model/payment/AdditionalData3DSecure.java similarity index 91% rename from src/main/java/com/adyen/model/payments/AdditionalData3DSecure.java rename to src/main/java/com/adyen/model/payment/AdditionalData3DSecure.java index 3bcaf9869..4bd329888 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/payment/AdditionalData3DSecure.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalData3DSecure diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataAirline.java b/src/main/java/com/adyen/model/payment/AdditionalDataAirline.java similarity index 96% rename from src/main/java/com/adyen/model/payments/AdditionalDataAirline.java rename to src/main/java/com/adyen/model/payment/AdditionalDataAirline.java index 36fe82fa6..e4abdb2e5 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataAirline.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataAirline.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalDataAirline diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataCarRental.java b/src/main/java/com/adyen/model/payment/AdditionalDataCarRental.java similarity index 96% rename from src/main/java/com/adyen/model/payments/AdditionalDataCarRental.java rename to src/main/java/com/adyen/model/payment/AdditionalDataCarRental.java index 460955905..c4032aa14 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataCarRental.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataCarRental.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalDataCarRental diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataCommon.java b/src/main/java/com/adyen/model/payment/AdditionalDataCommon.java similarity index 95% rename from src/main/java/com/adyen/model/payments/AdditionalDataCommon.java rename to src/main/java/com/adyen/model/payment/AdditionalDataCommon.java index 211de49e3..66c95e3ec 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataCommon.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalDataCommon diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataLevel23.java b/src/main/java/com/adyen/model/payment/AdditionalDataLevel23.java similarity index 95% rename from src/main/java/com/adyen/model/payments/AdditionalDataLevel23.java rename to src/main/java/com/adyen/model/payment/AdditionalDataLevel23.java index bd4cda31f..fd959ea2f 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataLevel23.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataLevel23.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalDataLevel23 diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataLodging.java b/src/main/java/com/adyen/model/payment/AdditionalDataLodging.java similarity index 95% rename from src/main/java/com/adyen/model/payments/AdditionalDataLodging.java rename to src/main/java/com/adyen/model/payment/AdditionalDataLodging.java index 6b981bc43..b8e971107 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataLodging.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataLodging.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalDataLodging diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataModifications.java b/src/main/java/com/adyen/model/payment/AdditionalDataModifications.java similarity index 81% rename from src/main/java/com/adyen/model/payments/AdditionalDataModifications.java rename to src/main/java/com/adyen/model/payment/AdditionalDataModifications.java index 33e386cd6..66330ccde 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataModifications.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataModifications.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalDataModifications diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataOpenInvoice.java b/src/main/java/com/adyen/model/payment/AdditionalDataOpenInvoice.java similarity index 95% rename from src/main/java/com/adyen/model/payments/AdditionalDataOpenInvoice.java rename to src/main/java/com/adyen/model/payment/AdditionalDataOpenInvoice.java index a96a5b231..fa5107f18 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataOpenInvoice.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataOpenInvoice.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalDataOpenInvoice diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataOpi.java b/src/main/java/com/adyen/model/payment/AdditionalDataOpi.java similarity index 80% rename from src/main/java/com/adyen/model/payments/AdditionalDataOpi.java rename to src/main/java/com/adyen/model/payment/AdditionalDataOpi.java index 001d2d86c..22ff30d88 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataOpi.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalDataOpi diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataRatepay.java b/src/main/java/com/adyen/model/payment/AdditionalDataRatepay.java similarity index 90% rename from src/main/java/com/adyen/model/payments/AdditionalDataRatepay.java rename to src/main/java/com/adyen/model/payment/AdditionalDataRatepay.java index 857b2e1eb..ed66fb835 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataRatepay.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRatepay.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalDataRatepay diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataRetry.java b/src/main/java/com/adyen/model/payment/AdditionalDataRetry.java similarity index 87% rename from src/main/java/com/adyen/model/payments/AdditionalDataRetry.java rename to src/main/java/com/adyen/model/payment/AdditionalDataRetry.java index 96a163549..fe4588349 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataRetry.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRetry.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalDataRetry diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataRisk.java b/src/main/java/com/adyen/model/payment/AdditionalDataRisk.java similarity index 96% rename from src/main/java/com/adyen/model/payments/AdditionalDataRisk.java rename to src/main/java/com/adyen/model/payment/AdditionalDataRisk.java index e88716c9b..ff5785c0e 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataRisk.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRisk.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalDataRisk diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataRiskStandalone.java b/src/main/java/com/adyen/model/payment/AdditionalDataRiskStandalone.java similarity index 93% rename from src/main/java/com/adyen/model/payments/AdditionalDataRiskStandalone.java rename to src/main/java/com/adyen/model/payment/AdditionalDataRiskStandalone.java index d44a0c65a..32ac29a69 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataRiskStandalone.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRiskStandalone.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalDataRiskStandalone diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataSubMerchant.java b/src/main/java/com/adyen/model/payment/AdditionalDataSubMerchant.java similarity index 93% rename from src/main/java/com/adyen/model/payments/AdditionalDataSubMerchant.java rename to src/main/java/com/adyen/model/payment/AdditionalDataSubMerchant.java index a99f75d32..85c06071f 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataSubMerchant.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataSubMerchant.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalDataSubMerchant diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataTemporaryServices.java b/src/main/java/com/adyen/model/payment/AdditionalDataTemporaryServices.java similarity index 92% rename from src/main/java/com/adyen/model/payments/AdditionalDataTemporaryServices.java rename to src/main/java/com/adyen/model/payment/AdditionalDataTemporaryServices.java index 00c4da16e..d84df387b 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataTemporaryServices.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataTemporaryServices.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalDataTemporaryServices diff --git a/src/main/java/com/adyen/model/payments/AdditionalDataWallets.java b/src/main/java/com/adyen/model/payment/AdditionalDataWallets.java similarity index 88% rename from src/main/java/com/adyen/model/payments/AdditionalDataWallets.java rename to src/main/java/com/adyen/model/payment/AdditionalDataWallets.java index f881dbcb2..33284a510 100644 --- a/src/main/java/com/adyen/model/payments/AdditionalDataWallets.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataWallets.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdditionalDataWallets diff --git a/src/main/java/com/adyen/model/payments/Address.java b/src/main/java/com/adyen/model/payment/Address.java similarity index 88% rename from src/main/java/com/adyen/model/payments/Address.java rename to src/main/java/com/adyen/model/payment/Address.java index 145ac7f7d..51b07ed4d 100644 --- a/src/main/java/com/adyen/model/payments/Address.java +++ b/src/main/java/com/adyen/model/payment/Address.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * Address diff --git a/src/main/java/com/adyen/model/payments/AdjustAuthorisationRequest.java b/src/main/java/com/adyen/model/payment/AdjustAuthorisationRequest.java similarity index 91% rename from src/main/java/com/adyen/model/payments/AdjustAuthorisationRequest.java rename to src/main/java/com/adyen/model/payment/AdjustAuthorisationRequest.java index d5de8a4cf..8d4812e96 100644 --- a/src/main/java/com/adyen/model/payments/AdjustAuthorisationRequest.java +++ b/src/main/java/com/adyen/model/payment/AdjustAuthorisationRequest.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,14 +11,14 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.Amount; -import com.adyen.model.payments.PlatformChargebackLogic; -import com.adyen.model.payments.Split; -import com.adyen.model.payments.ThreeDSecureData; +import com.adyen.model.payment.Amount; +import com.adyen.model.payment.PlatformChargebackLogic; +import com.adyen.model.payment.Split; +import com.adyen.model.payment.ThreeDSecureData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -49,7 +50,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AdjustAuthorisationRequest diff --git a/src/main/java/com/adyen/model/payments/Amount.java b/src/main/java/com/adyen/model/payment/Amount.java similarity index 81% rename from src/main/java/com/adyen/model/payments/Amount.java rename to src/main/java/com/adyen/model/payment/Amount.java index a6b136dd8..267971926 100644 --- a/src/main/java/com/adyen/model/payments/Amount.java +++ b/src/main/java/com/adyen/model/payment/Amount.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * Amount diff --git a/src/main/java/com/adyen/model/payments/ApplicationInfo.java b/src/main/java/com/adyen/model/payment/ApplicationInfo.java similarity index 86% rename from src/main/java/com/adyen/model/payments/ApplicationInfo.java rename to src/main/java/com/adyen/model/payment/ApplicationInfo.java index 371fb8d30..561089b24 100644 --- a/src/main/java/com/adyen/model/payments/ApplicationInfo.java +++ b/src/main/java/com/adyen/model/payment/ApplicationInfo.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,14 +11,14 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.CommonField; -import com.adyen.model.payments.ExternalPlatform; -import com.adyen.model.payments.MerchantDevice; -import com.adyen.model.payments.ShopperInteractionDevice; +import com.adyen.model.payment.CommonField; +import com.adyen.model.payment.ExternalPlatform; +import com.adyen.model.payment.MerchantDevice; +import com.adyen.model.payment.ShopperInteractionDevice; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -45,7 +46,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ApplicationInfo diff --git a/src/main/java/com/adyen/model/payments/AuthenticationResultRequest.java b/src/main/java/com/adyen/model/payment/AuthenticationResultRequest.java similarity index 83% rename from src/main/java/com/adyen/model/payments/AuthenticationResultRequest.java rename to src/main/java/com/adyen/model/payment/AuthenticationResultRequest.java index 3f8272ca2..39cd09901 100644 --- a/src/main/java/com/adyen/model/payments/AuthenticationResultRequest.java +++ b/src/main/java/com/adyen/model/payment/AuthenticationResultRequest.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AuthenticationResultRequest diff --git a/src/main/java/com/adyen/model/payments/AuthenticationResultResponse.java b/src/main/java/com/adyen/model/payment/AuthenticationResultResponse.java similarity index 80% rename from src/main/java/com/adyen/model/payments/AuthenticationResultResponse.java rename to src/main/java/com/adyen/model/payment/AuthenticationResultResponse.java index c90e827de..71cfafb53 100644 --- a/src/main/java/com/adyen/model/payments/AuthenticationResultResponse.java +++ b/src/main/java/com/adyen/model/payment/AuthenticationResultResponse.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,12 +11,12 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.ThreeDS1Result; -import com.adyen.model.payments.ThreeDS2Result; +import com.adyen.model.payment.ThreeDS1Result; +import com.adyen.model.payment.ThreeDS2Result; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -43,7 +44,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * AuthenticationResultResponse diff --git a/src/main/java/com/adyen/model/payments/BankAccount.java b/src/main/java/com/adyen/model/payment/BankAccount.java similarity index 90% rename from src/main/java/com/adyen/model/payments/BankAccount.java rename to src/main/java/com/adyen/model/payment/BankAccount.java index 61be7f06e..372e6bbfc 100644 --- a/src/main/java/com/adyen/model/payments/BankAccount.java +++ b/src/main/java/com/adyen/model/payment/BankAccount.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * BankAccount diff --git a/src/main/java/com/adyen/model/payments/BrowserInfo.java b/src/main/java/com/adyen/model/payment/BrowserInfo.java similarity index 89% rename from src/main/java/com/adyen/model/payments/BrowserInfo.java rename to src/main/java/com/adyen/model/payment/BrowserInfo.java index 8c16055cf..76f5e3670 100644 --- a/src/main/java/com/adyen/model/payments/BrowserInfo.java +++ b/src/main/java/com/adyen/model/payment/BrowserInfo.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * BrowserInfo diff --git a/src/main/java/com/adyen/model/payments/CancelOrRefundRequest.java b/src/main/java/com/adyen/model/payment/CancelOrRefundRequest.java similarity index 90% rename from src/main/java/com/adyen/model/payments/CancelOrRefundRequest.java rename to src/main/java/com/adyen/model/payment/CancelOrRefundRequest.java index 9af111b81..1db030d8e 100644 --- a/src/main/java/com/adyen/model/payments/CancelOrRefundRequest.java +++ b/src/main/java/com/adyen/model/payment/CancelOrRefundRequest.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,12 +11,12 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.PlatformChargebackLogic; -import com.adyen.model.payments.ThreeDSecureData; +import com.adyen.model.payment.PlatformChargebackLogic; +import com.adyen.model.payment.ThreeDSecureData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -46,7 +47,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * CancelOrRefundRequest diff --git a/src/main/java/com/adyen/model/payments/CancelRequest.java b/src/main/java/com/adyen/model/payment/CancelRequest.java similarity index 91% rename from src/main/java/com/adyen/model/payments/CancelRequest.java rename to src/main/java/com/adyen/model/payment/CancelRequest.java index 23a050e19..2ffa85ca9 100644 --- a/src/main/java/com/adyen/model/payments/CancelRequest.java +++ b/src/main/java/com/adyen/model/payment/CancelRequest.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,13 +11,13 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.PlatformChargebackLogic; -import com.adyen.model.payments.Split; -import com.adyen.model.payments.ThreeDSecureData; +import com.adyen.model.payment.PlatformChargebackLogic; +import com.adyen.model.payment.Split; +import com.adyen.model.payment.ThreeDSecureData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -48,7 +49,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * CancelRequest diff --git a/src/main/java/com/adyen/model/payments/CaptureRequest.java b/src/main/java/com/adyen/model/payment/CaptureRequest.java similarity index 91% rename from src/main/java/com/adyen/model/payments/CaptureRequest.java rename to src/main/java/com/adyen/model/payment/CaptureRequest.java index 06be9dd73..ea0b70179 100644 --- a/src/main/java/com/adyen/model/payments/CaptureRequest.java +++ b/src/main/java/com/adyen/model/payment/CaptureRequest.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,14 +11,14 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.Amount; -import com.adyen.model.payments.PlatformChargebackLogic; -import com.adyen.model.payments.Split; -import com.adyen.model.payments.ThreeDSecureData; +import com.adyen.model.payment.Amount; +import com.adyen.model.payment.PlatformChargebackLogic; +import com.adyen.model.payment.Split; +import com.adyen.model.payment.ThreeDSecureData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -49,7 +50,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * CaptureRequest diff --git a/src/main/java/com/adyen/model/payments/Card.java b/src/main/java/com/adyen/model/payment/Card.java similarity index 89% rename from src/main/java/com/adyen/model/payments/Card.java rename to src/main/java/com/adyen/model/payment/Card.java index 9cf33d1b0..3617fd5d4 100644 --- a/src/main/java/com/adyen/model/payments/Card.java +++ b/src/main/java/com/adyen/model/payment/Card.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * Card diff --git a/src/main/java/com/adyen/model/payments/CommonField.java b/src/main/java/com/adyen/model/payment/CommonField.java similarity index 80% rename from src/main/java/com/adyen/model/payments/CommonField.java rename to src/main/java/com/adyen/model/payment/CommonField.java index b93bcbfa0..0c806cd5f 100644 --- a/src/main/java/com/adyen/model/payments/CommonField.java +++ b/src/main/java/com/adyen/model/payment/CommonField.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * CommonField diff --git a/src/main/java/com/adyen/model/payments/DeviceRenderOptions.java b/src/main/java/com/adyen/model/payment/DeviceRenderOptions.java similarity index 86% rename from src/main/java/com/adyen/model/payments/DeviceRenderOptions.java rename to src/main/java/com/adyen/model/payment/DeviceRenderOptions.java index 9c653c9a8..d25add229 100644 --- a/src/main/java/com/adyen/model/payments/DeviceRenderOptions.java +++ b/src/main/java/com/adyen/model/payment/DeviceRenderOptions.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -43,7 +44,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * DeviceRenderOptions diff --git a/src/main/java/com/adyen/model/payments/DonationRequest.java b/src/main/java/com/adyen/model/payment/DonationRequest.java similarity index 88% rename from src/main/java/com/adyen/model/payments/DonationRequest.java rename to src/main/java/com/adyen/model/payment/DonationRequest.java index d5eab7d1e..7caee1bc6 100644 --- a/src/main/java/com/adyen/model/payments/DonationRequest.java +++ b/src/main/java/com/adyen/model/payment/DonationRequest.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,12 +11,12 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.Amount; -import com.adyen.model.payments.PlatformChargebackLogic; +import com.adyen.model.payment.Amount; +import com.adyen.model.payment.PlatformChargebackLogic; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -43,7 +44,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * DonationRequest diff --git a/src/main/java/com/adyen/model/payments/ExternalPlatform.java b/src/main/java/com/adyen/model/payment/ExternalPlatform.java similarity index 82% rename from src/main/java/com/adyen/model/payments/ExternalPlatform.java rename to src/main/java/com/adyen/model/payment/ExternalPlatform.java index b61c10cfd..2f98c9eaa 100644 --- a/src/main/java/com/adyen/model/payments/ExternalPlatform.java +++ b/src/main/java/com/adyen/model/payment/ExternalPlatform.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ExternalPlatform diff --git a/src/main/java/com/adyen/model/payments/ForexQuote.java b/src/main/java/com/adyen/model/payment/ForexQuote.java similarity index 90% rename from src/main/java/com/adyen/model/payments/ForexQuote.java rename to src/main/java/com/adyen/model/payment/ForexQuote.java index 73e186cb4..f7f2c2cee 100644 --- a/src/main/java/com/adyen/model/payments/ForexQuote.java +++ b/src/main/java/com/adyen/model/payment/ForexQuote.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,11 +11,11 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.Amount; +import com.adyen.model.payment.Amount; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -43,7 +44,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ForexQuote diff --git a/src/main/java/com/adyen/model/payments/FraudCheckResult.java b/src/main/java/com/adyen/model/payment/FraudCheckResult.java similarity index 82% rename from src/main/java/com/adyen/model/payments/FraudCheckResult.java rename to src/main/java/com/adyen/model/payment/FraudCheckResult.java index 67a64e647..ccef65785 100644 --- a/src/main/java/com/adyen/model/payments/FraudCheckResult.java +++ b/src/main/java/com/adyen/model/payment/FraudCheckResult.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * FraudCheckResult diff --git a/src/main/java/com/adyen/model/payments/FraudCheckResultWrapper.java b/src/main/java/com/adyen/model/payment/FraudCheckResultWrapper.java similarity index 78% rename from src/main/java/com/adyen/model/payments/FraudCheckResultWrapper.java rename to src/main/java/com/adyen/model/payment/FraudCheckResultWrapper.java index 1fc6ceddb..b590a4fa1 100644 --- a/src/main/java/com/adyen/model/payments/FraudCheckResultWrapper.java +++ b/src/main/java/com/adyen/model/payment/FraudCheckResultWrapper.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,11 +11,11 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.FraudCheckResult; +import com.adyen.model.payment.FraudCheckResult; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -42,7 +43,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * FraudCheckResultWrapper diff --git a/src/main/java/com/adyen/model/payments/FraudResult.java b/src/main/java/com/adyen/model/payment/FraudResult.java similarity index 81% rename from src/main/java/com/adyen/model/payments/FraudResult.java rename to src/main/java/com/adyen/model/payment/FraudResult.java index 1a6956a85..11e69289f 100644 --- a/src/main/java/com/adyen/model/payments/FraudResult.java +++ b/src/main/java/com/adyen/model/payment/FraudResult.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,11 +11,11 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.FraudCheckResultWrapper; +import com.adyen.model.payment.FraudCheckResultWrapper; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -44,7 +45,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * FraudResult diff --git a/src/main/java/com/adyen/model/payments/FundDestination.java b/src/main/java/com/adyen/model/payment/FundDestination.java similarity index 89% rename from src/main/java/com/adyen/model/payments/FundDestination.java rename to src/main/java/com/adyen/model/payment/FundDestination.java index 6a60a89fc..cb7f154be 100644 --- a/src/main/java/com/adyen/model/payments/FundDestination.java +++ b/src/main/java/com/adyen/model/payment/FundDestination.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,14 +11,14 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.Address; -import com.adyen.model.payments.Card; -import com.adyen.model.payments.Name; -import com.adyen.model.payments.SubMerchant; +import com.adyen.model.payment.Address; +import com.adyen.model.payment.Card; +import com.adyen.model.payment.Name; +import com.adyen.model.payment.SubMerchant; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -48,7 +49,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * FundDestination diff --git a/src/main/java/com/adyen/model/payments/FundSource.java b/src/main/java/com/adyen/model/payment/FundSource.java similarity index 85% rename from src/main/java/com/adyen/model/payments/FundSource.java rename to src/main/java/com/adyen/model/payment/FundSource.java index c862c9e5a..e2d5115f4 100644 --- a/src/main/java/com/adyen/model/payments/FundSource.java +++ b/src/main/java/com/adyen/model/payment/FundSource.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,13 +11,13 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.Address; -import com.adyen.model.payments.Card; -import com.adyen.model.payments.Name; +import com.adyen.model.payment.Address; +import com.adyen.model.payment.Card; +import com.adyen.model.payment.Name; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -47,7 +48,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * FundSource diff --git a/src/main/java/com/adyen/model/payments/Installments.java b/src/main/java/com/adyen/model/payment/Installments.java similarity index 84% rename from src/main/java/com/adyen/model/payments/Installments.java rename to src/main/java/com/adyen/model/payment/Installments.java index cb700abbb..99fd1d1ef 100644 --- a/src/main/java/com/adyen/model/payments/Installments.java +++ b/src/main/java/com/adyen/model/payment/Installments.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * Installments diff --git a/src/main/java/com/adyen/model/payments/JSON.java b/src/main/java/com/adyen/model/payment/JSON.java similarity index 74% rename from src/main/java/com/adyen/model/payments/JSON.java rename to src/main/java/com/adyen/model/payment/JSON.java index ea27d6b53..761562ecc 100644 --- a/src/main/java/com/adyen/model/payments/JSON.java +++ b/src/main/java/com/adyen/model/payment/JSON.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -92,84 +93,84 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AccountInfo.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AcctInfo.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalData3DSecure.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalDataAirline.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalDataCarRental.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalDataCommon.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalDataLevel23.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalDataLodging.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalDataModifications.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalDataOpenInvoice.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalDataOpi.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalDataRatepay.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalDataRetry.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalDataRisk.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalDataRiskStandalone.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalDataSubMerchant.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalDataTemporaryServices.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdditionalDataWallets.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.Address.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AdjustAuthorisationRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.Amount.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ApplicationInfo.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AuthenticationResultRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.AuthenticationResultResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.BankAccount.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.BrowserInfo.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.CancelOrRefundRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.CancelRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.CaptureRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.Card.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.CommonField.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.DeviceRenderOptions.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.DonationRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ExternalPlatform.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ForexQuote.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.FraudCheckResult.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.FraudCheckResultWrapper.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.FraudResult.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.FundDestination.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.FundSource.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.Installments.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.Mandate.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.MerchantDevice.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.MerchantRiskIndicator.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ModificationResult.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.Name.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.PaymentRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.PaymentRequest3d.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.PaymentRequest3ds2.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.PaymentResult.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.Phone.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.PlatformChargebackLogic.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.Recurring.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.RefundRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ResponseAdditionalData3DSecure.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ResponseAdditionalDataBillingAddress.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ResponseAdditionalDataCard.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ResponseAdditionalDataCommon.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ResponseAdditionalDataInstallments.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ResponseAdditionalDataNetworkTokens.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ResponseAdditionalDataOpi.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ResponseAdditionalDataSepa.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.SDKEphemPubKey.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ServiceError.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ShopperInteractionDevice.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.Split.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.SplitAmount.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.SubMerchant.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.TechnicalCancelRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ThreeDS1Result.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ThreeDS2RequestData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ThreeDS2Result.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ThreeDS2ResultRequest.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ThreeDS2ResultResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ThreeDSRequestorAuthenticationInfo.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ThreeDSRequestorPriorAuthenticationInfo.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.ThreeDSecureData.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payments.VoidPendingRefundRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AccountInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AcctInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalData3DSecure.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalDataAirline.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalDataCarRental.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalDataCommon.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalDataLevel23.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalDataLodging.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalDataModifications.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalDataOpenInvoice.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalDataOpi.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalDataRatepay.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalDataRetry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalDataRisk.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalDataRiskStandalone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalDataSubMerchant.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalDataTemporaryServices.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdditionalDataWallets.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.Address.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AdjustAuthorisationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.Amount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ApplicationInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AuthenticationResultRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.AuthenticationResultResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.BankAccount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.BrowserInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.CancelOrRefundRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.CancelRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.CaptureRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.Card.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.CommonField.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.DeviceRenderOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.DonationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ExternalPlatform.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ForexQuote.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.FraudCheckResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.FraudCheckResultWrapper.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.FraudResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.FundDestination.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.FundSource.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.Installments.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.Mandate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.MerchantDevice.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.MerchantRiskIndicator.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ModificationResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.Name.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.PaymentRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.PaymentRequest3d.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.PaymentRequest3ds2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.PaymentResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.Phone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.PlatformChargebackLogic.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.Recurring.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.RefundRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ResponseAdditionalData3DSecure.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ResponseAdditionalDataBillingAddress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ResponseAdditionalDataCard.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ResponseAdditionalDataCommon.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ResponseAdditionalDataInstallments.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ResponseAdditionalDataNetworkTokens.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ResponseAdditionalDataOpi.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ResponseAdditionalDataSepa.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.SDKEphemPubKey.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ServiceError.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ShopperInteractionDevice.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.Split.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.SplitAmount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.SubMerchant.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.TechnicalCancelRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ThreeDS1Result.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ThreeDS2RequestData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ThreeDS2Result.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ThreeDS2ResultRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ThreeDS2ResultResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ThreeDSRequestorAuthenticationInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ThreeDSRequestorPriorAuthenticationInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.ThreeDSecureData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.payment.VoidPendingRefundRequest.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } diff --git a/src/main/java/com/adyen/model/payments/Mandate.java b/src/main/java/com/adyen/model/payment/Mandate.java similarity index 92% rename from src/main/java/com/adyen/model/payments/Mandate.java rename to src/main/java/com/adyen/model/payment/Mandate.java index d5bed8c16..71918180f 100644 --- a/src/main/java/com/adyen/model/payments/Mandate.java +++ b/src/main/java/com/adyen/model/payment/Mandate.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * Mandate diff --git a/src/main/java/com/adyen/model/payments/MerchantDevice.java b/src/main/java/com/adyen/model/payment/MerchantDevice.java similarity index 82% rename from src/main/java/com/adyen/model/payments/MerchantDevice.java rename to src/main/java/com/adyen/model/payment/MerchantDevice.java index a83c856da..324099a75 100644 --- a/src/main/java/com/adyen/model/payments/MerchantDevice.java +++ b/src/main/java/com/adyen/model/payment/MerchantDevice.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * MerchantDevice diff --git a/src/main/java/com/adyen/model/payments/MerchantRiskIndicator.java b/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java similarity index 93% rename from src/main/java/com/adyen/model/payments/MerchantRiskIndicator.java rename to src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java index 252a52d0b..57e9ad2c4 100644 --- a/src/main/java/com/adyen/model/payments/MerchantRiskIndicator.java +++ b/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,11 +11,11 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.Amount; +import com.adyen.model.payment.Amount; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -43,7 +44,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * MerchantRiskIndicator diff --git a/src/main/java/com/adyen/model/payments/ModificationResult.java b/src/main/java/com/adyen/model/payment/ModificationResult.java similarity index 86% rename from src/main/java/com/adyen/model/payments/ModificationResult.java rename to src/main/java/com/adyen/model/payment/ModificationResult.java index 88bfd7750..6268bc262 100644 --- a/src/main/java/com/adyen/model/payments/ModificationResult.java +++ b/src/main/java/com/adyen/model/payment/ModificationResult.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -44,7 +45,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ModificationResult diff --git a/src/main/java/com/adyen/model/payments/Name.java b/src/main/java/com/adyen/model/payment/Name.java similarity index 81% rename from src/main/java/com/adyen/model/payments/Name.java rename to src/main/java/com/adyen/model/payment/Name.java index 746d4c0da..2e6f05f85 100644 --- a/src/main/java/com/adyen/model/payments/Name.java +++ b/src/main/java/com/adyen/model/payment/Name.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * Name diff --git a/src/main/java/com/adyen/model/payments/PaymentRequest.java b/src/main/java/com/adyen/model/payment/PaymentRequest.java similarity index 97% rename from src/main/java/com/adyen/model/payments/PaymentRequest.java rename to src/main/java/com/adyen/model/payment/PaymentRequest.java index 75d4fff65..34141b0b4 100644 --- a/src/main/java/com/adyen/model/payments/PaymentRequest.java +++ b/src/main/java/com/adyen/model/payment/PaymentRequest.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,29 +11,29 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.AccountInfo; -import com.adyen.model.payments.Address; -import com.adyen.model.payments.Amount; -import com.adyen.model.payments.ApplicationInfo; -import com.adyen.model.payments.BankAccount; -import com.adyen.model.payments.BrowserInfo; -import com.adyen.model.payments.Card; -import com.adyen.model.payments.ForexQuote; -import com.adyen.model.payments.FundDestination; -import com.adyen.model.payments.FundSource; -import com.adyen.model.payments.Installments; -import com.adyen.model.payments.Mandate; -import com.adyen.model.payments.MerchantRiskIndicator; -import com.adyen.model.payments.Name; -import com.adyen.model.payments.PlatformChargebackLogic; -import com.adyen.model.payments.Recurring; -import com.adyen.model.payments.Split; -import com.adyen.model.payments.ThreeDS2RequestData; -import com.adyen.model.payments.ThreeDSecureData; +import com.adyen.model.payment.AccountInfo; +import com.adyen.model.payment.Address; +import com.adyen.model.payment.Amount; +import com.adyen.model.payment.ApplicationInfo; +import com.adyen.model.payment.BankAccount; +import com.adyen.model.payment.BrowserInfo; +import com.adyen.model.payment.Card; +import com.adyen.model.payment.ForexQuote; +import com.adyen.model.payment.FundDestination; +import com.adyen.model.payment.FundSource; +import com.adyen.model.payment.Installments; +import com.adyen.model.payment.Mandate; +import com.adyen.model.payment.MerchantRiskIndicator; +import com.adyen.model.payment.Name; +import com.adyen.model.payment.PlatformChargebackLogic; +import com.adyen.model.payment.Recurring; +import com.adyen.model.payment.Split; +import com.adyen.model.payment.ThreeDS2RequestData; +import com.adyen.model.payment.ThreeDSecureData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -66,7 +67,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * PaymentRequest diff --git a/src/main/java/com/adyen/model/payments/PaymentRequest3d.java b/src/main/java/com/adyen/model/payment/PaymentRequest3d.java similarity index 97% rename from src/main/java/com/adyen/model/payments/PaymentRequest3d.java rename to src/main/java/com/adyen/model/payment/PaymentRequest3d.java index 3df0150f6..eb661e758 100644 --- a/src/main/java/com/adyen/model/payments/PaymentRequest3d.java +++ b/src/main/java/com/adyen/model/payment/PaymentRequest3d.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,22 +11,22 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.AccountInfo; -import com.adyen.model.payments.Address; -import com.adyen.model.payments.Amount; -import com.adyen.model.payments.ApplicationInfo; -import com.adyen.model.payments.BrowserInfo; -import com.adyen.model.payments.ForexQuote; -import com.adyen.model.payments.Installments; -import com.adyen.model.payments.MerchantRiskIndicator; -import com.adyen.model.payments.Name; -import com.adyen.model.payments.Recurring; -import com.adyen.model.payments.Split; -import com.adyen.model.payments.ThreeDS2RequestData; +import com.adyen.model.payment.AccountInfo; +import com.adyen.model.payment.Address; +import com.adyen.model.payment.Amount; +import com.adyen.model.payment.ApplicationInfo; +import com.adyen.model.payment.BrowserInfo; +import com.adyen.model.payment.ForexQuote; +import com.adyen.model.payment.Installments; +import com.adyen.model.payment.MerchantRiskIndicator; +import com.adyen.model.payment.Name; +import com.adyen.model.payment.Recurring; +import com.adyen.model.payment.Split; +import com.adyen.model.payment.ThreeDS2RequestData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -59,7 +60,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * PaymentRequest3d diff --git a/src/main/java/com/adyen/model/payments/PaymentRequest3ds2.java b/src/main/java/com/adyen/model/payment/PaymentRequest3ds2.java similarity index 97% rename from src/main/java/com/adyen/model/payments/PaymentRequest3ds2.java rename to src/main/java/com/adyen/model/payment/PaymentRequest3ds2.java index 3be027097..869f3a66f 100644 --- a/src/main/java/com/adyen/model/payments/PaymentRequest3ds2.java +++ b/src/main/java/com/adyen/model/payment/PaymentRequest3ds2.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,23 +11,23 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.AccountInfo; -import com.adyen.model.payments.Address; -import com.adyen.model.payments.Amount; -import com.adyen.model.payments.ApplicationInfo; -import com.adyen.model.payments.BrowserInfo; -import com.adyen.model.payments.ForexQuote; -import com.adyen.model.payments.Installments; -import com.adyen.model.payments.MerchantRiskIndicator; -import com.adyen.model.payments.Name; -import com.adyen.model.payments.Recurring; -import com.adyen.model.payments.Split; -import com.adyen.model.payments.ThreeDS2RequestData; -import com.adyen.model.payments.ThreeDS2Result; +import com.adyen.model.payment.AccountInfo; +import com.adyen.model.payment.Address; +import com.adyen.model.payment.Amount; +import com.adyen.model.payment.ApplicationInfo; +import com.adyen.model.payment.BrowserInfo; +import com.adyen.model.payment.ForexQuote; +import com.adyen.model.payment.Installments; +import com.adyen.model.payment.MerchantRiskIndicator; +import com.adyen.model.payment.Name; +import com.adyen.model.payment.Recurring; +import com.adyen.model.payment.Split; +import com.adyen.model.payment.ThreeDS2RequestData; +import com.adyen.model.payment.ThreeDS2Result; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -60,7 +61,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * PaymentRequest3ds2 diff --git a/src/main/java/com/adyen/model/payments/PaymentResult.java b/src/main/java/com/adyen/model/payment/PaymentResult.java similarity index 93% rename from src/main/java/com/adyen/model/payments/PaymentResult.java rename to src/main/java/com/adyen/model/payment/PaymentResult.java index 3e2165847..f9858d872 100644 --- a/src/main/java/com/adyen/model/payments/PaymentResult.java +++ b/src/main/java/com/adyen/model/payment/PaymentResult.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,12 +11,12 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.Amount; -import com.adyen.model.payments.FraudResult; +import com.adyen.model.payment.Amount; +import com.adyen.model.payment.FraudResult; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -46,7 +47,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * PaymentResult diff --git a/src/main/java/com/adyen/model/payments/Phone.java b/src/main/java/com/adyen/model/payment/Phone.java similarity index 80% rename from src/main/java/com/adyen/model/payments/Phone.java rename to src/main/java/com/adyen/model/payment/Phone.java index 422683e85..1a5c2702d 100644 --- a/src/main/java/com/adyen/model/payments/Phone.java +++ b/src/main/java/com/adyen/model/payment/Phone.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * Phone diff --git a/src/main/java/com/adyen/model/payments/PlatformChargebackLogic.java b/src/main/java/com/adyen/model/payment/PlatformChargebackLogic.java similarity index 85% rename from src/main/java/com/adyen/model/payments/PlatformChargebackLogic.java rename to src/main/java/com/adyen/model/payment/PlatformChargebackLogic.java index 0aac5a774..2034ea8b0 100644 --- a/src/main/java/com/adyen/model/payments/PlatformChargebackLogic.java +++ b/src/main/java/com/adyen/model/payment/PlatformChargebackLogic.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * PlatformChargebackLogic diff --git a/src/main/java/com/adyen/model/payments/Recurring.java b/src/main/java/com/adyen/model/payment/Recurring.java similarity index 90% rename from src/main/java/com/adyen/model/payments/Recurring.java rename to src/main/java/com/adyen/model/payment/Recurring.java index bb85e36e7..09d310b41 100644 --- a/src/main/java/com/adyen/model/payments/Recurring.java +++ b/src/main/java/com/adyen/model/payment/Recurring.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -42,7 +43,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * Recurring diff --git a/src/main/java/com/adyen/model/payments/RefundRequest.java b/src/main/java/com/adyen/model/payment/RefundRequest.java similarity index 91% rename from src/main/java/com/adyen/model/payments/RefundRequest.java rename to src/main/java/com/adyen/model/payment/RefundRequest.java index 3123a9ce6..e1abd35ec 100644 --- a/src/main/java/com/adyen/model/payments/RefundRequest.java +++ b/src/main/java/com/adyen/model/payment/RefundRequest.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,14 +11,14 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.Amount; -import com.adyen.model.payments.PlatformChargebackLogic; -import com.adyen.model.payments.Split; -import com.adyen.model.payments.ThreeDSecureData; +import com.adyen.model.payment.Amount; +import com.adyen.model.payment.PlatformChargebackLogic; +import com.adyen.model.payment.Split; +import com.adyen.model.payment.ThreeDSecureData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -49,7 +50,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * RefundRequest diff --git a/src/main/java/com/adyen/model/payments/ResponseAdditionalData3DSecure.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalData3DSecure.java similarity index 87% rename from src/main/java/com/adyen/model/payments/ResponseAdditionalData3DSecure.java rename to src/main/java/com/adyen/model/payment/ResponseAdditionalData3DSecure.java index cb6c358d8..dab3f96f8 100644 --- a/src/main/java/com/adyen/model/payments/ResponseAdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalData3DSecure.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ResponseAdditionalData3DSecure diff --git a/src/main/java/com/adyen/model/payments/ResponseAdditionalDataBillingAddress.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataBillingAddress.java similarity index 89% rename from src/main/java/com/adyen/model/payments/ResponseAdditionalDataBillingAddress.java rename to src/main/java/com/adyen/model/payment/ResponseAdditionalDataBillingAddress.java index 1e3f95c72..aedd18ccd 100644 --- a/src/main/java/com/adyen/model/payments/ResponseAdditionalDataBillingAddress.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataBillingAddress.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ResponseAdditionalDataBillingAddress diff --git a/src/main/java/com/adyen/model/payments/ResponseAdditionalDataCard.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCard.java similarity index 90% rename from src/main/java/com/adyen/model/payments/ResponseAdditionalDataCard.java rename to src/main/java/com/adyen/model/payment/ResponseAdditionalDataCard.java index 3568e2257..89f08ff85 100644 --- a/src/main/java/com/adyen/model/payments/ResponseAdditionalDataCard.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCard.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ResponseAdditionalDataCard diff --git a/src/main/java/com/adyen/model/payments/ResponseAdditionalDataCommon.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCommon.java similarity index 98% rename from src/main/java/com/adyen/model/payments/ResponseAdditionalDataCommon.java rename to src/main/java/com/adyen/model/payment/ResponseAdditionalDataCommon.java index 55f85c721..86afdb5a4 100644 --- a/src/main/java/com/adyen/model/payments/ResponseAdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCommon.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ResponseAdditionalDataCommon diff --git a/src/main/java/com/adyen/model/payments/ResponseAdditionalDataInstallments.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataInstallments.java similarity index 94% rename from src/main/java/com/adyen/model/payments/ResponseAdditionalDataInstallments.java rename to src/main/java/com/adyen/model/payment/ResponseAdditionalDataInstallments.java index 522d35385..cf64b2aa3 100644 --- a/src/main/java/com/adyen/model/payments/ResponseAdditionalDataInstallments.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataInstallments.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ResponseAdditionalDataInstallments diff --git a/src/main/java/com/adyen/model/payments/ResponseAdditionalDataNetworkTokens.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataNetworkTokens.java similarity index 85% rename from src/main/java/com/adyen/model/payments/ResponseAdditionalDataNetworkTokens.java rename to src/main/java/com/adyen/model/payment/ResponseAdditionalDataNetworkTokens.java index 9efdb83b2..7c3517c21 100644 --- a/src/main/java/com/adyen/model/payments/ResponseAdditionalDataNetworkTokens.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataNetworkTokens.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ResponseAdditionalDataNetworkTokens diff --git a/src/main/java/com/adyen/model/payments/ResponseAdditionalDataOpi.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataOpi.java similarity index 80% rename from src/main/java/com/adyen/model/payments/ResponseAdditionalDataOpi.java rename to src/main/java/com/adyen/model/payment/ResponseAdditionalDataOpi.java index f357219dc..c141d66d9 100644 --- a/src/main/java/com/adyen/model/payments/ResponseAdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataOpi.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ResponseAdditionalDataOpi diff --git a/src/main/java/com/adyen/model/payments/ResponseAdditionalDataSepa.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSepa.java similarity index 86% rename from src/main/java/com/adyen/model/payments/ResponseAdditionalDataSepa.java rename to src/main/java/com/adyen/model/payment/ResponseAdditionalDataSepa.java index 085935b50..8f3fc1278 100644 --- a/src/main/java/com/adyen/model/payments/ResponseAdditionalDataSepa.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSepa.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ResponseAdditionalDataSepa diff --git a/src/main/java/com/adyen/model/payments/SDKEphemPubKey.java b/src/main/java/com/adyen/model/payment/SDKEphemPubKey.java similarity index 83% rename from src/main/java/com/adyen/model/payments/SDKEphemPubKey.java rename to src/main/java/com/adyen/model/payment/SDKEphemPubKey.java index bb8f51eb4..a68d9a8c5 100644 --- a/src/main/java/com/adyen/model/payments/SDKEphemPubKey.java +++ b/src/main/java/com/adyen/model/payment/SDKEphemPubKey.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * SDKEphemPubKey diff --git a/src/main/java/com/adyen/model/payments/ServiceError.java b/src/main/java/com/adyen/model/payment/ServiceError.java similarity index 86% rename from src/main/java/com/adyen/model/payments/ServiceError.java rename to src/main/java/com/adyen/model/payment/ServiceError.java index 4a1261fad..4425f792e 100644 --- a/src/main/java/com/adyen/model/payments/ServiceError.java +++ b/src/main/java/com/adyen/model/payment/ServiceError.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -44,7 +45,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ServiceError diff --git a/src/main/java/com/adyen/model/payments/ShopperInteractionDevice.java b/src/main/java/com/adyen/model/payment/ShopperInteractionDevice.java similarity index 83% rename from src/main/java/com/adyen/model/payments/ShopperInteractionDevice.java rename to src/main/java/com/adyen/model/payment/ShopperInteractionDevice.java index 39a6aaa96..632da3281 100644 --- a/src/main/java/com/adyen/model/payments/ShopperInteractionDevice.java +++ b/src/main/java/com/adyen/model/payment/ShopperInteractionDevice.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ShopperInteractionDevice diff --git a/src/main/java/com/adyen/model/payments/Split.java b/src/main/java/com/adyen/model/payment/Split.java similarity index 88% rename from src/main/java/com/adyen/model/payments/Split.java rename to src/main/java/com/adyen/model/payment/Split.java index 14b5e23bc..3be520802 100644 --- a/src/main/java/com/adyen/model/payments/Split.java +++ b/src/main/java/com/adyen/model/payment/Split.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,11 +11,11 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.SplitAmount; +import com.adyen.model.payment.SplitAmount; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -42,7 +43,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * Split diff --git a/src/main/java/com/adyen/model/payments/SplitAmount.java b/src/main/java/com/adyen/model/payment/SplitAmount.java similarity index 81% rename from src/main/java/com/adyen/model/payments/SplitAmount.java rename to src/main/java/com/adyen/model/payment/SplitAmount.java index 49bec4430..cd5622b80 100644 --- a/src/main/java/com/adyen/model/payments/SplitAmount.java +++ b/src/main/java/com/adyen/model/payment/SplitAmount.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * SplitAmount diff --git a/src/main/java/com/adyen/model/payments/SubMerchant.java b/src/main/java/com/adyen/model/payment/SubMerchant.java similarity index 86% rename from src/main/java/com/adyen/model/payments/SubMerchant.java rename to src/main/java/com/adyen/model/payment/SubMerchant.java index ba4314a78..06cca6450 100644 --- a/src/main/java/com/adyen/model/payments/SubMerchant.java +++ b/src/main/java/com/adyen/model/payment/SubMerchant.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * SubMerchant diff --git a/src/main/java/com/adyen/model/payments/TechnicalCancelRequest.java b/src/main/java/com/adyen/model/payment/TechnicalCancelRequest.java similarity index 91% rename from src/main/java/com/adyen/model/payments/TechnicalCancelRequest.java rename to src/main/java/com/adyen/model/payment/TechnicalCancelRequest.java index 28bcc0406..96a347b98 100644 --- a/src/main/java/com/adyen/model/payments/TechnicalCancelRequest.java +++ b/src/main/java/com/adyen/model/payment/TechnicalCancelRequest.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,14 +11,14 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.Amount; -import com.adyen.model.payments.PlatformChargebackLogic; -import com.adyen.model.payments.Split; -import com.adyen.model.payments.ThreeDSecureData; +import com.adyen.model.payment.Amount; +import com.adyen.model.payment.PlatformChargebackLogic; +import com.adyen.model.payment.Split; +import com.adyen.model.payment.ThreeDSecureData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -49,7 +50,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * TechnicalCancelRequest diff --git a/src/main/java/com/adyen/model/payments/ThreeDS1Result.java b/src/main/java/com/adyen/model/payment/ThreeDS1Result.java similarity index 87% rename from src/main/java/com/adyen/model/payments/ThreeDS1Result.java rename to src/main/java/com/adyen/model/payment/ThreeDS1Result.java index 3d1e4d967..ef6b552ae 100644 --- a/src/main/java/com/adyen/model/payments/ThreeDS1Result.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS1Result.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ThreeDS1Result diff --git a/src/main/java/com/adyen/model/payments/ThreeDS2RequestData.java b/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java similarity index 97% rename from src/main/java/com/adyen/model/payments/ThreeDS2RequestData.java rename to src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java index 80753cc57..23353310a 100644 --- a/src/main/java/com/adyen/model/payments/ThreeDS2RequestData.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,16 +11,16 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.AcctInfo; -import com.adyen.model.payments.DeviceRenderOptions; -import com.adyen.model.payments.Phone; -import com.adyen.model.payments.SDKEphemPubKey; -import com.adyen.model.payments.ThreeDSRequestorAuthenticationInfo; -import com.adyen.model.payments.ThreeDSRequestorPriorAuthenticationInfo; +import com.adyen.model.payment.AcctInfo; +import com.adyen.model.payment.DeviceRenderOptions; +import com.adyen.model.payment.Phone; +import com.adyen.model.payment.SDKEphemPubKey; +import com.adyen.model.payment.ThreeDSRequestorAuthenticationInfo; +import com.adyen.model.payment.ThreeDSRequestorPriorAuthenticationInfo; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -47,7 +48,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ThreeDS2RequestData diff --git a/src/main/java/com/adyen/model/payments/ThreeDS2Result.java b/src/main/java/com/adyen/model/payment/ThreeDS2Result.java similarity index 94% rename from src/main/java/com/adyen/model/payments/ThreeDS2Result.java rename to src/main/java/com/adyen/model/payment/ThreeDS2Result.java index 836e6a0f8..647de1858 100644 --- a/src/main/java/com/adyen/model/payments/ThreeDS2Result.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2Result.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ThreeDS2Result diff --git a/src/main/java/com/adyen/model/payments/ThreeDS2ResultRequest.java b/src/main/java/com/adyen/model/payment/ThreeDS2ResultRequest.java similarity index 82% rename from src/main/java/com/adyen/model/payments/ThreeDS2ResultRequest.java rename to src/main/java/com/adyen/model/payment/ThreeDS2ResultRequest.java index aba6bbb75..edad0e721 100644 --- a/src/main/java/com/adyen/model/payments/ThreeDS2ResultRequest.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2ResultRequest.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ThreeDS2ResultRequest diff --git a/src/main/java/com/adyen/model/payments/ThreeDS2ResultResponse.java b/src/main/java/com/adyen/model/payment/ThreeDS2ResultResponse.java similarity index 78% rename from src/main/java/com/adyen/model/payments/ThreeDS2ResultResponse.java rename to src/main/java/com/adyen/model/payment/ThreeDS2ResultResponse.java index 5de296f93..3cca54dbe 100644 --- a/src/main/java/com/adyen/model/payments/ThreeDS2ResultResponse.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2ResultResponse.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,11 +11,11 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.ThreeDS2Result; +import com.adyen.model.payment.ThreeDS2Result; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -42,7 +43,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ThreeDS2ResultResponse diff --git a/src/main/java/com/adyen/model/payments/ThreeDSRequestorAuthenticationInfo.java b/src/main/java/com/adyen/model/payment/ThreeDSRequestorAuthenticationInfo.java similarity index 88% rename from src/main/java/com/adyen/model/payments/ThreeDSRequestorAuthenticationInfo.java rename to src/main/java/com/adyen/model/payment/ThreeDSRequestorAuthenticationInfo.java index 2d17f1505..1d1337549 100644 --- a/src/main/java/com/adyen/model/payments/ThreeDSRequestorAuthenticationInfo.java +++ b/src/main/java/com/adyen/model/payment/ThreeDSRequestorAuthenticationInfo.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ThreeDSRequestorAuthenticationInfo diff --git a/src/main/java/com/adyen/model/payments/ThreeDSRequestorPriorAuthenticationInfo.java b/src/main/java/com/adyen/model/payment/ThreeDSRequestorPriorAuthenticationInfo.java similarity index 89% rename from src/main/java/com/adyen/model/payments/ThreeDSRequestorPriorAuthenticationInfo.java rename to src/main/java/com/adyen/model/payment/ThreeDSRequestorPriorAuthenticationInfo.java index 8e8e45abb..14bf36733 100644 --- a/src/main/java/com/adyen/model/payments/ThreeDSRequestorPriorAuthenticationInfo.java +++ b/src/main/java/com/adyen/model/payment/ThreeDSRequestorPriorAuthenticationInfo.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ThreeDSRequestorPriorAuthenticationInfo diff --git a/src/main/java/com/adyen/model/payments/ThreeDSecureData.java b/src/main/java/com/adyen/model/payment/ThreeDSecureData.java similarity index 93% rename from src/main/java/com/adyen/model/payments/ThreeDSecureData.java rename to src/main/java/com/adyen/model/payment/ThreeDSecureData.java index 74b65cbee..a001e656d 100644 --- a/src/main/java/com/adyen/model/payments/ThreeDSecureData.java +++ b/src/main/java/com/adyen/model/payment/ThreeDSecureData.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; @@ -41,7 +42,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * ThreeDSecureData diff --git a/src/main/java/com/adyen/model/payments/VoidPendingRefundRequest.java b/src/main/java/com/adyen/model/payment/VoidPendingRefundRequest.java similarity index 91% rename from src/main/java/com/adyen/model/payments/VoidPendingRefundRequest.java rename to src/main/java/com/adyen/model/payment/VoidPendingRefundRequest.java index 34dee6c93..241e523c6 100644 --- a/src/main/java/com/adyen/model/payments/VoidPendingRefundRequest.java +++ b/src/main/java/com/adyen/model/payment/VoidPendingRefundRequest.java @@ -1,5 +1,6 @@ /* * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. * * The version of the OpenAPI document: 68 * Contact: developer-experience@adyen.com @@ -10,14 +11,14 @@ */ -package com.adyen.model.payments; +package com.adyen.model.payment; import java.util.Objects; import java.util.Arrays; -import com.adyen.model.payments.Amount; -import com.adyen.model.payments.PlatformChargebackLogic; -import com.adyen.model.payments.Split; -import com.adyen.model.payments.ThreeDSecureData; +import com.adyen.model.payment.Amount; +import com.adyen.model.payment.PlatformChargebackLogic; +import com.adyen.model.payment.Split; +import com.adyen.model.payment.ThreeDSecureData; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -49,7 +50,7 @@ import java.util.Map.Entry; import java.util.Set; -import com.adyen.model.payments.JSON; +import com.adyen.model.payment.JSON; /** * VoidPendingRefundRequest diff --git a/src/main/java/com/adyen/model/payments/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/posterminalmanagement/AbstractOpenApiSchema.java similarity index 69% rename from src/main/java/com/adyen/model/payments/AbstractOpenApiSchema.java rename to src/main/java/com/adyen/model/posterminalmanagement/AbstractOpenApiSchema.java index 80e05a994..961897ed1 100644 --- a/src/main/java/com/adyen/model/payments/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/AbstractOpenApiSchema.java @@ -1,7 +1,8 @@ /* - * Adyen Payment API + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. * - * The version of the OpenAPI document: 68 + * The version of the OpenAPI document: 1 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -10,7 +11,7 @@ */ -package com.adyen.model.payments; +package com.adyen.model.posterminalmanagement; import java.util.Objects; import java.lang.reflect.Type; diff --git a/src/main/java/com/adyen/model/posterminalmanagement/Address.java b/src/main/java/com/adyen/model/posterminalmanagement/Address.java old mode 100755 new mode 100644 index 64a997f68..e45cf69d7 --- a/src/main/java/com/adyen/model/posterminalmanagement/Address.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/Address.java @@ -1,210 +1,374 @@ - /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. * - * Adyen Java API Library + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.posterminalmanagement; import java.util.Objects; - +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.posterminalmanagement.JSON; /** * Address */ public class Address { - @SerializedName("city") - private String city = null; + public static final String SERIALIZED_NAME_CITY = "city"; + @SerializedName(SERIALIZED_NAME_CITY) + private String city; - @SerializedName("countryCode") - private String countryCode = null; + public static final String SERIALIZED_NAME_COUNTRY_CODE = "countryCode"; + @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) + private String countryCode; - @SerializedName("postalCode") - private String postalCode = null; + public static final String SERIALIZED_NAME_POSTAL_CODE = "postalCode"; + @SerializedName(SERIALIZED_NAME_POSTAL_CODE) + private String postalCode; - @SerializedName("stateOrProvince") - private String stateOrProvince = null; + public static final String SERIALIZED_NAME_STATE_OR_PROVINCE = "stateOrProvince"; + @SerializedName(SERIALIZED_NAME_STATE_OR_PROVINCE) + private String stateOrProvince; - @SerializedName("streetAddress") - private String streetAddress = null; + public static final String SERIALIZED_NAME_STREET_ADDRESS = "streetAddress"; + @SerializedName(SERIALIZED_NAME_STREET_ADDRESS) + private String streetAddress; - @SerializedName("streetAddress2") - private String streetAddress2 = null; + public static final String SERIALIZED_NAME_STREET_ADDRESS2 = "streetAddress2"; + @SerializedName(SERIALIZED_NAME_STREET_ADDRESS2) + private String streetAddress2; - public Address city(String city) { - this.city = city; - return this; - } + public Address() { + } - /** - * Get city - * - * @return city - **/ - public String getCity() { - return city; - } + public Address city(String city) { + + this.city = city; + return this; + } - public void setCity(String city) { - this.city = city; - } + /** + * Get city + * @return city + **/ + @ApiModelProperty(value = "") - public Address countryCode(String countryCode) { - this.countryCode = countryCode; - return this; - } + public String getCity() { + return city; + } - /** - * Get countryCode - * - * @return countryCode - **/ - public String getCountryCode() { - return countryCode; - } - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; - } + public void setCity(String city) { + this.city = city; + } - public Address postalCode(String postalCode) { - this.postalCode = postalCode; - return this; - } - /** - * Get postalCode - * - * @return postalCode - **/ - public String getPostalCode() { - return postalCode; - } + public Address countryCode(String countryCode) { + + this.countryCode = countryCode; + return this; + } - public void setPostalCode(String postalCode) { - this.postalCode = postalCode; - } + /** + * Get countryCode + * @return countryCode + **/ + @ApiModelProperty(value = "") - public Address stateOrProvince(String stateOrProvince) { - this.stateOrProvince = stateOrProvince; - return this; - } + public String getCountryCode() { + return countryCode; + } - /** - * Get stateOrProvince - * - * @return stateOrProvince - **/ - public String getStateOrProvince() { - return stateOrProvince; - } - public void setStateOrProvince(String stateOrProvince) { - this.stateOrProvince = stateOrProvince; - } + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + } - public Address streetAddress(String streetAddress) { - this.streetAddress = streetAddress; - return this; - } - /** - * Get streetAddress - * - * @return streetAddress - **/ - public String getStreetAddress() { - return streetAddress; - } + public Address postalCode(String postalCode) { + + this.postalCode = postalCode; + return this; + } - public void setStreetAddress(String streetAddress) { - this.streetAddress = streetAddress; - } + /** + * Get postalCode + * @return postalCode + **/ + @ApiModelProperty(value = "") - public Address streetAddress2(String streetAddress2) { - this.streetAddress2 = streetAddress2; - return this; - } + public String getPostalCode() { + return postalCode; + } - /** - * Get streetAddress2 - * - * @return streetAddress2 - **/ - public String getStreetAddress2() { - return streetAddress2; - } - public void setStreetAddress2(String streetAddress2) { - this.streetAddress2 = streetAddress2; - } + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Address address = (Address) o; - return Objects.equals(this.city, address.city) && - Objects.equals(this.countryCode, address.countryCode) && - Objects.equals(this.postalCode, address.postalCode) && - Objects.equals(this.stateOrProvince, address.stateOrProvince) && - Objects.equals(this.streetAddress, address.streetAddress) && - Objects.equals(this.streetAddress2, address.streetAddress2); - } + public Address stateOrProvince(String stateOrProvince) { + + this.stateOrProvince = stateOrProvince; + return this; + } - @Override - public int hashCode() { - return Objects.hash(city, countryCode, postalCode, stateOrProvince, streetAddress, streetAddress2); - } + /** + * Get stateOrProvince + * @return stateOrProvince + **/ + @ApiModelProperty(value = "") + public String getStateOrProvince() { + return stateOrProvince; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Address {\n"); - - sb.append(" city: ").append(toIndentedString(city)).append("\n"); - sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); - sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); - sb.append(" stateOrProvince: ").append(toIndentedString(stateOrProvince)).append("\n"); - sb.append(" streetAddress: ").append(toIndentedString(streetAddress)).append("\n"); - sb.append(" streetAddress2: ").append(toIndentedString(streetAddress2)).append("\n"); - sb.append("}"); - return sb.toString(); + + public void setStateOrProvince(String stateOrProvince) { + this.stateOrProvince = stateOrProvince; + } + + + public Address streetAddress(String streetAddress) { + + this.streetAddress = streetAddress; + return this; + } + + /** + * Get streetAddress + * @return streetAddress + **/ + @ApiModelProperty(value = "") + + public String getStreetAddress() { + return streetAddress; + } + + + public void setStreetAddress(String streetAddress) { + this.streetAddress = streetAddress; + } + + + public Address streetAddress2(String streetAddress2) { + + this.streetAddress2 = streetAddress2; + return this; + } + + /** + * Get streetAddress2 + * @return streetAddress2 + **/ + @ApiModelProperty(value = "") + + public String getStreetAddress2() { + return streetAddress2; + } + + + public void setStreetAddress2(String streetAddress2) { + this.streetAddress2 = streetAddress2; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + Address address = (Address) o; + return Objects.equals(this.city, address.city) && + Objects.equals(this.countryCode, address.countryCode) && + Objects.equals(this.postalCode, address.postalCode) && + Objects.equals(this.stateOrProvince, address.stateOrProvince) && + Objects.equals(this.streetAddress, address.streetAddress) && + Objects.equals(this.streetAddress2, address.streetAddress2); + } + + @Override + public int hashCode() { + return Objects.hash(city, countryCode, postalCode, stateOrProvince, streetAddress, streetAddress2); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Address {\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); + sb.append(" stateOrProvince: ").append(toIndentedString(stateOrProvince)).append("\n"); + sb.append(" streetAddress: ").append(toIndentedString(streetAddress)).append("\n"); + sb.append(" streetAddress2: ").append(toIndentedString(streetAddress2)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("city"); + openapiFields.add("countryCode"); + openapiFields.add("postalCode"); + openapiFields.add("stateOrProvince"); + openapiFields.add("streetAddress"); + openapiFields.add("streetAddress2"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Address + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Address.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Address is not found in the empty JSON string", Address.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Address.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Address` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - return o.toString().replace("\n", "\n "); + } + // validate the optional field city + if (jsonObj.get("city") != null && !jsonObj.get("city").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("city").toString())); + } + // validate the optional field countryCode + if (jsonObj.get("countryCode") != null && !jsonObj.get("countryCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `countryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countryCode").toString())); + } + // validate the optional field postalCode + if (jsonObj.get("postalCode") != null && !jsonObj.get("postalCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("postalCode").toString())); + } + // validate the optional field stateOrProvince + if (jsonObj.get("stateOrProvince") != null && !jsonObj.get("stateOrProvince").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `stateOrProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateOrProvince").toString())); + } + // validate the optional field streetAddress + if (jsonObj.get("streetAddress") != null && !jsonObj.get("streetAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `streetAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("streetAddress").toString())); + } + // validate the optional field streetAddress2 + if (jsonObj.get("streetAddress2") != null && !jsonObj.get("streetAddress2").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `streetAddress2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("streetAddress2").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Address.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Address' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter
thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Address.class)); + + return (TypeAdapter) new TypeAdapter
() { + @Override + public void write(JsonWriter out, Address value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Address read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); } - + } + + /** + * Create an instance of Address given an JSON string + * + * @param jsonString JSON string + * @return An instance of Address + * @throws IOException if the JSON string is invalid with respect to Address + */ + public static Address fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Address.class); + } + + /** + * Convert an instance of Address to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsRequest.java b/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsRequest.java old mode 100755 new mode 100644 index 3f1d54973..116f61983 --- a/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsRequest.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsRequest.java @@ -1,193 +1,353 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. * - * Adyen Java API Library + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.posterminalmanagement; import java.util.Objects; - +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.posterminalmanagement.JSON; + /** * AssignTerminalsRequest */ public class AssignTerminalsRequest { - @SerializedName("companyAccount") - private String companyAccount = null; + public static final String SERIALIZED_NAME_COMPANY_ACCOUNT = "companyAccount"; + @SerializedName(SERIALIZED_NAME_COMPANY_ACCOUNT) + private String companyAccount; - @SerializedName("merchantAccount") - private String merchantAccount = null; + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT = "merchantAccount"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) + private String merchantAccount; - @SerializedName("merchantInventory") - private Boolean merchantInventory = null; + public static final String SERIALIZED_NAME_MERCHANT_INVENTORY = "merchantInventory"; + @SerializedName(SERIALIZED_NAME_MERCHANT_INVENTORY) + private Boolean merchantInventory; - @SerializedName("store") - private String store = null; + public static final String SERIALIZED_NAME_STORE = "store"; + @SerializedName(SERIALIZED_NAME_STORE) + private String store; - @SerializedName("terminals") - private List terminals = new ArrayList(); + public static final String SERIALIZED_NAME_TERMINALS = "terminals"; + @SerializedName(SERIALIZED_NAME_TERMINALS) + private List terminals = new ArrayList<>(); - public AssignTerminalsRequest companyAccount(String companyAccount) { - this.companyAccount = companyAccount; - return this; - } + public AssignTerminalsRequest() { + } - /** - * Your company account. To return terminals to the company inventory, specify only this parameter and the `terminals`. - * - * @return companyAccount - **/ - public String getCompanyAccount() { - return companyAccount; - } + public AssignTerminalsRequest companyAccount(String companyAccount) { + + this.companyAccount = companyAccount; + return this; + } - public void setCompanyAccount(String companyAccount) { - this.companyAccount = companyAccount; - } + /** + * Your company account. To return terminals to the company inventory, specify only this parameter and the `terminals`. + * @return companyAccount + **/ + @ApiModelProperty(required = true, value = "Your company account. To return terminals to the company inventory, specify only this parameter and the `terminals`.") - public AssignTerminalsRequest merchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - return this; - } + public String getCompanyAccount() { + return companyAccount; + } - /** - * Name of the merchant account. Specify this parameter to assign terminals to this merchant account or to a store under this merchant account. - * - * @return merchantAccount - **/ - public String getMerchantAccount() { - return merchantAccount; - } - public void setMerchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - } + public void setCompanyAccount(String companyAccount) { + this.companyAccount = companyAccount; + } - public AssignTerminalsRequest merchantInventory(Boolean merchantInventory) { - this.merchantInventory = merchantInventory; - return this; - } - /** - * Boolean that indicates if you are assigning the terminals to the merchant inventory. Do not use when assigning terminals to a store. Required when assigning the terminal to a merchant account. - Set this to **true** to assign the terminals to the merchant inventory. This also means that the terminals cannot be boarded. - Set this to **false** to assign the terminals to the merchant account as in-store terminals. This makes the terminals ready to be boarded and to process payments through the specified merchant account. - * - * @return merchantInventory - **/ - public Boolean isMerchantInventory() { - return merchantInventory; - } + public AssignTerminalsRequest merchantAccount(String merchantAccount) { + + this.merchantAccount = merchantAccount; + return this; + } - public void setMerchantInventory(Boolean merchantInventory) { - this.merchantInventory = merchantInventory; - } + /** + * Name of the merchant account. Specify this parameter to assign terminals to this merchant account or to a store under this merchant account. + * @return merchantAccount + **/ + @ApiModelProperty(value = "Name of the merchant account. Specify this parameter to assign terminals to this merchant account or to a store under this merchant account.") - public AssignTerminalsRequest store(String store) { - this.store = store; - return this; - } + public String getMerchantAccount() { + return merchantAccount; + } - /** - * The store code of the store that you want to assign the terminals to. - * - * @return store - **/ - public String getStore() { - return store; - } - public void setStore(String store) { - this.store = store; - } + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } - public AssignTerminalsRequest terminals(List terminals) { - this.terminals = terminals; - return this; - } - public AssignTerminalsRequest addTerminalsItem(String terminalsItem) { - this.terminals.add(terminalsItem); - return this; - } + public AssignTerminalsRequest merchantInventory(Boolean merchantInventory) { + + this.merchantInventory = merchantInventory; + return this; + } - /** - * Array containing a list of terminal IDs that you want to assign or reassign to the merchant account or store, or that you want to return to the company inventory. For example, `[\"V400m-324689776\",\"P400Plus-329127412\"]`. - * - * @return terminals - **/ - public List getTerminals() { - return terminals; - } + /** + * Boolean that indicates if you are assigning the terminals to the merchant inventory. Do not use when assigning terminals to a store. Required when assigning the terminal to a merchant account. - Set this to **true** to assign the terminals to the merchant inventory. This also means that the terminals cannot be boarded. - Set this to **false** to assign the terminals to the merchant account as in-store terminals. This makes the terminals ready to be boarded and to process payments through the specified merchant account. + * @return merchantInventory + **/ + @ApiModelProperty(value = "Boolean that indicates if you are assigning the terminals to the merchant inventory. Do not use when assigning terminals to a store. Required when assigning the terminal to a merchant account. - Set this to **true** to assign the terminals to the merchant inventory. This also means that the terminals cannot be boarded. - Set this to **false** to assign the terminals to the merchant account as in-store terminals. This makes the terminals ready to be boarded and to process payments through the specified merchant account.") - public void setTerminals(List terminals) { - this.terminals = terminals; - } + public Boolean getMerchantInventory() { + return merchantInventory; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AssignTerminalsRequest assignTerminalsRequest = (AssignTerminalsRequest) o; - return Objects.equals(this.companyAccount, assignTerminalsRequest.companyAccount) && - Objects.equals(this.merchantAccount, assignTerminalsRequest.merchantAccount) && - Objects.equals(this.merchantInventory, assignTerminalsRequest.merchantInventory) && - Objects.equals(this.store, assignTerminalsRequest.store) && - Objects.equals(this.terminals, assignTerminalsRequest.terminals); - } + public void setMerchantInventory(Boolean merchantInventory) { + this.merchantInventory = merchantInventory; + } - @Override - public int hashCode() { - return Objects.hash(companyAccount, merchantAccount, merchantInventory, store, terminals); - } + public AssignTerminalsRequest store(String store) { + + this.store = store; + return this; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AssignTerminalsRequest {\n"); - - sb.append(" companyAccount: ").append(toIndentedString(companyAccount)).append("\n"); - sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); - sb.append(" merchantInventory: ").append(toIndentedString(merchantInventory)).append("\n"); - sb.append(" store: ").append(toIndentedString(store)).append("\n"); - sb.append(" terminals: ").append(toIndentedString(terminals)).append("\n"); - sb.append("}"); - return sb.toString(); + /** + * The store code of the store that you want to assign the terminals to. + * @return store + **/ + @ApiModelProperty(value = "The store code of the store that you want to assign the terminals to.") + + public String getStore() { + return store; + } + + + public void setStore(String store) { + this.store = store; + } + + + public AssignTerminalsRequest terminals(List terminals) { + + this.terminals = terminals; + return this; + } + + public AssignTerminalsRequest addTerminalsItem(String terminalsItem) { + this.terminals.add(terminalsItem); + return this; + } + + /** + * Array containing a list of terminal IDs that you want to assign or reassign to the merchant account or store, or that you want to return to the company inventory. For example, `[\"V400m-324689776\",\"P400Plus-329127412\"]`. + * @return terminals + **/ + @ApiModelProperty(required = true, value = "Array containing a list of terminal IDs that you want to assign or reassign to the merchant account or store, or that you want to return to the company inventory. For example, `[\"V400m-324689776\",\"P400Plus-329127412\"]`.") + + public List getTerminals() { + return terminals; + } + + + public void setTerminals(List terminals) { + this.terminals = terminals; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssignTerminalsRequest assignTerminalsRequest = (AssignTerminalsRequest) o; + return Objects.equals(this.companyAccount, assignTerminalsRequest.companyAccount) && + Objects.equals(this.merchantAccount, assignTerminalsRequest.merchantAccount) && + Objects.equals(this.merchantInventory, assignTerminalsRequest.merchantInventory) && + Objects.equals(this.store, assignTerminalsRequest.store) && + Objects.equals(this.terminals, assignTerminalsRequest.terminals); + } + + @Override + public int hashCode() { + return Objects.hash(companyAccount, merchantAccount, merchantInventory, store, terminals); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssignTerminalsRequest {\n"); + sb.append(" companyAccount: ").append(toIndentedString(companyAccount)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" merchantInventory: ").append(toIndentedString(merchantInventory)).append("\n"); + sb.append(" store: ").append(toIndentedString(store)).append("\n"); + sb.append(" terminals: ").append(toIndentedString(terminals)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("companyAccount"); + openapiFields.add("merchantAccount"); + openapiFields.add("merchantInventory"); + openapiFields.add("store"); + openapiFields.add("terminals"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("companyAccount"); + openapiRequiredFields.add("terminals"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AssignTerminalsRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AssignTerminalsRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AssignTerminalsRequest is not found in the empty JSON string", AssignTerminalsRequest.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AssignTerminalsRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssignTerminalsRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - return o.toString().replace("\n", "\n "); - } + } + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AssignTerminalsRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field companyAccount + if (jsonObj.get("companyAccount") != null && !jsonObj.get("companyAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `companyAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyAccount").toString())); + } + // validate the optional field merchantAccount + if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); + } + // validate the optional field store + if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); + } + // ensure the json data is an array + if (jsonObj.get("terminals") != null && !jsonObj.get("terminals").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `terminals` to be an array in the JSON string but got `%s`", jsonObj.get("terminals").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssignTerminalsRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssignTerminalsRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssignTerminalsRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssignTerminalsRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssignTerminalsRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssignTerminalsRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssignTerminalsRequest + * @throws IOException if the JSON string is invalid with respect to AssignTerminalsRequest + */ + public static AssignTerminalsRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssignTerminalsRequest.class); + } + + /** + * Convert an instance of AssignTerminalsRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsResponse.java b/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsResponse.java old mode 100755 new mode 100644 index 0cbf1a9cc..e8ecf082a --- a/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsResponse.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsResponse.java @@ -1,102 +1,221 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. * - * Adyen Java API Library + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.posterminalmanagement; import java.util.Objects; - +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.posterminalmanagement.JSON; /** * AssignTerminalsResponse */ public class AssignTerminalsResponse { - @SerializedName("results") - private Map results = new HashMap(); + public static final String SERIALIZED_NAME_RESULTS = "results"; + @SerializedName(SERIALIZED_NAME_RESULTS) + private Map results = new HashMap<>(); - public AssignTerminalsResponse results(Map results) { - this.results = results; - return this; - } + public AssignTerminalsResponse() { + } - public AssignTerminalsResponse putResultsItem(String key, String resultsItem) { - this.results.put(key, resultsItem); - return this; - } + public AssignTerminalsResponse results(Map results) { + + this.results = results; + return this; + } - /** - * Array that returns a list of the terminals, and for each terminal the result of assigning it to an account or store. The results can be: - `Done`: The terminal has been assigned. - `AssignmentScheduled`: The terminal will be assigned asynschronously. - `RemoveConfigScheduled`: The terminal was previously assigned and boarded. Wait for the terminal to synchronize with the Adyen platform. For more information, refer to [Reassigning boarded terminals](https://docs.adyen.com/point-of-sale/managing-terminals/assign-terminals#reassign-boarded-terminals). - `Error`: There was an error when assigning the terminal. - * - * @return results - **/ - public Map getResults() { - return results; - } + public AssignTerminalsResponse putResultsItem(String key, String resultsItem) { + this.results.put(key, resultsItem); + return this; + } - public void setResults(Map results) { - this.results = results; - } + /** + * Array that returns a list of the terminals, and for each terminal the result of assigning it to an account or store. The results can be: - `Done`: The terminal has been assigned. - `AssignmentScheduled`: The terminal will be assigned asynschronously. - `RemoveConfigScheduled`: The terminal was previously assigned and boarded. Wait for the terminal to synchronize with the Adyen platform. For more information, refer to [Reassigning boarded terminals](https://docs.adyen.com/point-of-sale/managing-terminals/assign-terminals#reassign-boarded-terminals). - `Error`: There was an error when assigning the terminal. + * @return results + **/ + @ApiModelProperty(required = true, value = "Array that returns a list of the terminals, and for each terminal the result of assigning it to an account or store. The results can be: - `Done`: The terminal has been assigned. - `AssignmentScheduled`: The terminal will be assigned asynschronously. - `RemoveConfigScheduled`: The terminal was previously assigned and boarded. Wait for the terminal to synchronize with the Adyen platform. For more information, refer to [Reassigning boarded terminals](https://docs.adyen.com/point-of-sale/managing-terminals/assign-terminals#reassign-boarded-terminals). - `Error`: There was an error when assigning the terminal. ") + public Map getResults() { + return results; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AssignTerminalsResponse assignTerminalsResponse = (AssignTerminalsResponse) o; - return Objects.equals(this.results, assignTerminalsResponse.results); - } - @Override - public int hashCode() { - return Objects.hash(results); - } + public void setResults(Map results) { + this.results = results; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AssignTerminalsResponse {\n"); - sb.append(" results: ").append(toIndentedString(results)).append("\n"); - sb.append("}"); - return sb.toString(); + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + AssignTerminalsResponse assignTerminalsResponse = (AssignTerminalsResponse) o; + return Objects.equals(this.results, assignTerminalsResponse.results); + } + + @Override + public int hashCode() { + return Objects.hash(results); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AssignTerminalsResponse {\n"); + sb.append(" results: ").append(toIndentedString(results)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("results"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("results"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AssignTerminalsResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AssignTerminalsResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AssignTerminalsResponse is not found in the empty JSON string", AssignTerminalsResponse.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AssignTerminalsResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AssignTerminalsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - return o.toString().replace("\n", "\n "); - } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AssignTerminalsResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AssignTerminalsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AssignTerminalsResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AssignTerminalsResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AssignTerminalsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AssignTerminalsResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AssignTerminalsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AssignTerminalsResponse + * @throws IOException if the JSON string is invalid with respect to AssignTerminalsResponse + */ + public static AssignTerminalsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AssignTerminalsResponse.class); + } + + /** + * Convert an instance of AssignTerminalsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalRequest.java b/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalRequest.java old mode 100755 new mode 100644 index 19c2fdf9a..e1cf39e19 --- a/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalRequest.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalRequest.java @@ -1,94 +1,217 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. * - * Adyen Java API Library + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.posterminalmanagement; import java.util.Objects; - +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.posterminalmanagement.JSON; /** * FindTerminalRequest */ public class FindTerminalRequest { - @SerializedName("terminal") - private String terminal = null; + public static final String SERIALIZED_NAME_TERMINAL = "terminal"; + @SerializedName(SERIALIZED_NAME_TERMINAL) + private String terminal; - public FindTerminalRequest terminal(String terminal) { - this.terminal = terminal; - return this; - } + public FindTerminalRequest() { + } - /** - * The unique terminal ID in the format `[Device model]-[Serial number]`. For example, **V400m-324689776**. - * - * @return terminal - **/ - public String getTerminal() { - return terminal; - } + public FindTerminalRequest terminal(String terminal) { + + this.terminal = terminal; + return this; + } - public void setTerminal(String terminal) { - this.terminal = terminal; - } + /** + * The unique terminal ID in the format `[Device model]-[Serial number]`. For example, **V400m-324689776**. + * @return terminal + **/ + @ApiModelProperty(required = true, value = "The unique terminal ID in the format `[Device model]-[Serial number]`. For example, **V400m-324689776**.") + public String getTerminal() { + return terminal; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FindTerminalRequest findTerminalRequest = (FindTerminalRequest) o; - return Objects.equals(this.terminal, findTerminalRequest.terminal); - } - @Override - public int hashCode() { - return Objects.hash(terminal); - } + public void setTerminal(String terminal) { + this.terminal = terminal; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FindTerminalRequest {\n"); - sb.append(" terminal: ").append(toIndentedString(terminal)).append("\n"); - sb.append("}"); - return sb.toString(); + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } + FindTerminalRequest findTerminalRequest = (FindTerminalRequest) o; + return Objects.equals(this.terminal, findTerminalRequest.terminal); + } + + @Override + public int hashCode() { + return Objects.hash(terminal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindTerminalRequest {\n"); + sb.append(" terminal: ").append(toIndentedString(terminal)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("terminal"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("terminal"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FindTerminalRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FindTerminalRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FindTerminalRequest is not found in the empty JSON string", FindTerminalRequest.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FindTerminalRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FindTerminalRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - return o.toString().replace("\n", "\n "); - } + } + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FindTerminalRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field terminal + if (jsonObj.get("terminal") != null && !jsonObj.get("terminal").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `terminal` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminal").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FindTerminalRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FindTerminalRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FindTerminalRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FindTerminalRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FindTerminalRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FindTerminalRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FindTerminalRequest + * @throws IOException if the JSON string is invalid with respect to FindTerminalRequest + */ + public static FindTerminalRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FindTerminalRequest.class); + } + + /** + * Convert an instance of FindTerminalRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalResponse.java b/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalResponse.java old mode 100755 new mode 100644 index fc5332be3..94abae9f7 --- a/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalResponse.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalResponse.java @@ -1,186 +1,346 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. * - * Adyen Java API Library + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.posterminalmanagement; import java.util.Objects; - +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.posterminalmanagement.JSON; /** * FindTerminalResponse */ public class FindTerminalResponse { - @SerializedName("companyAccount") - private String companyAccount = null; + public static final String SERIALIZED_NAME_COMPANY_ACCOUNT = "companyAccount"; + @SerializedName(SERIALIZED_NAME_COMPANY_ACCOUNT) + private String companyAccount; - @SerializedName("merchantAccount") - private String merchantAccount = null; + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT = "merchantAccount"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) + private String merchantAccount; - @SerializedName("merchantInventory") - private Boolean merchantInventory = null; + public static final String SERIALIZED_NAME_MERCHANT_INVENTORY = "merchantInventory"; + @SerializedName(SERIALIZED_NAME_MERCHANT_INVENTORY) + private Boolean merchantInventory; - @SerializedName("store") - private String store = null; + public static final String SERIALIZED_NAME_STORE = "store"; + @SerializedName(SERIALIZED_NAME_STORE) + private String store; - @SerializedName("terminal") - private String terminal = null; + public static final String SERIALIZED_NAME_TERMINAL = "terminal"; + @SerializedName(SERIALIZED_NAME_TERMINAL) + private String terminal; - public FindTerminalResponse companyAccount(String companyAccount) { - this.companyAccount = companyAccount; - return this; - } + public FindTerminalResponse() { + } - /** - * The company account that the terminal is associated with. If this is the only account level shown in the response, the terminal is assigned to the inventory of the company account. - * - * @return companyAccount - **/ - public String getCompanyAccount() { - return companyAccount; - } + public FindTerminalResponse companyAccount(String companyAccount) { + + this.companyAccount = companyAccount; + return this; + } - public void setCompanyAccount(String companyAccount) { - this.companyAccount = companyAccount; - } + /** + * The company account that the terminal is associated with. If this is the only account level shown in the response, the terminal is assigned to the inventory of the company account. + * @return companyAccount + **/ + @ApiModelProperty(required = true, value = "The company account that the terminal is associated with. If this is the only account level shown in the response, the terminal is assigned to the inventory of the company account.") - public FindTerminalResponse merchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - return this; - } + public String getCompanyAccount() { + return companyAccount; + } - /** - * The merchant account that the terminal is associated with. If the response doesn't contain a `store` the terminal is assigned to this merchant account. - * - * @return merchantAccount - **/ - public String getMerchantAccount() { - return merchantAccount; - } - public void setMerchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - } + public void setCompanyAccount(String companyAccount) { + this.companyAccount = companyAccount; + } - public FindTerminalResponse merchantInventory(Boolean merchantInventory) { - this.merchantInventory = merchantInventory; - return this; - } - /** - * Boolean that indicates if the terminal is assigned to the merchant inventory. This is returned when the terminal is assigned to a merchant account. - If **true**, this indicates that the terminal is in the merchant inventory. This also means that the terminal cannot be boarded. - If **false**, this indicates that the terminal is assigned to the merchant account as an in-store terminal. This means that the terminal is ready to be boarded, or is already boarded. - * - * @return merchantInventory - **/ - public Boolean isMerchantInventory() { - return merchantInventory; - } + public FindTerminalResponse merchantAccount(String merchantAccount) { + + this.merchantAccount = merchantAccount; + return this; + } - public void setMerchantInventory(Boolean merchantInventory) { - this.merchantInventory = merchantInventory; - } + /** + * The merchant account that the terminal is associated with. If the response doesn't contain a `store` the terminal is assigned to this merchant account. + * @return merchantAccount + **/ + @ApiModelProperty(value = "The merchant account that the terminal is associated with. If the response doesn't contain a `store` the terminal is assigned to this merchant account.") - public FindTerminalResponse store(String store) { - this.store = store; - return this; - } + public String getMerchantAccount() { + return merchantAccount; + } - /** - * The store code of the store that the terminal is assigned to. - * - * @return store - **/ - public String getStore() { - return store; - } - public void setStore(String store) { - this.store = store; - } + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } - public FindTerminalResponse terminal(String terminal) { - this.terminal = terminal; - return this; - } - /** - * The unique terminal ID. - * - * @return terminal - **/ - public String getTerminal() { - return terminal; - } + public FindTerminalResponse merchantInventory(Boolean merchantInventory) { + + this.merchantInventory = merchantInventory; + return this; + } - public void setTerminal(String terminal) { - this.terminal = terminal; - } + /** + * Boolean that indicates if the terminal is assigned to the merchant inventory. This is returned when the terminal is assigned to a merchant account. - If **true**, this indicates that the terminal is in the merchant inventory. This also means that the terminal cannot be boarded. - If **false**, this indicates that the terminal is assigned to the merchant account as an in-store terminal. This means that the terminal is ready to be boarded, or is already boarded. + * @return merchantInventory + **/ + @ApiModelProperty(value = "Boolean that indicates if the terminal is assigned to the merchant inventory. This is returned when the terminal is assigned to a merchant account. - If **true**, this indicates that the terminal is in the merchant inventory. This also means that the terminal cannot be boarded. - If **false**, this indicates that the terminal is assigned to the merchant account as an in-store terminal. This means that the terminal is ready to be boarded, or is already boarded.") + public Boolean getMerchantInventory() { + return merchantInventory; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FindTerminalResponse findTerminalResponse = (FindTerminalResponse) o; - return Objects.equals(this.companyAccount, findTerminalResponse.companyAccount) && - Objects.equals(this.merchantAccount, findTerminalResponse.merchantAccount) && - Objects.equals(this.merchantInventory, findTerminalResponse.merchantInventory) && - Objects.equals(this.store, findTerminalResponse.store) && - Objects.equals(this.terminal, findTerminalResponse.terminal); - } - @Override - public int hashCode() { - return Objects.hash(companyAccount, merchantAccount, merchantInventory, store, terminal); - } + public void setMerchantInventory(Boolean merchantInventory) { + this.merchantInventory = merchantInventory; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FindTerminalResponse {\n"); - - sb.append(" companyAccount: ").append(toIndentedString(companyAccount)).append("\n"); - sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); - sb.append(" merchantInventory: ").append(toIndentedString(merchantInventory)).append("\n"); - sb.append(" store: ").append(toIndentedString(store)).append("\n"); - sb.append(" terminal: ").append(toIndentedString(terminal)).append("\n"); - sb.append("}"); - return sb.toString(); + public FindTerminalResponse store(String store) { + + this.store = store; + return this; + } + + /** + * The store code of the store that the terminal is assigned to. + * @return store + **/ + @ApiModelProperty(value = "The store code of the store that the terminal is assigned to.") + + public String getStore() { + return store; + } + + + public void setStore(String store) { + this.store = store; + } + + + public FindTerminalResponse terminal(String terminal) { + + this.terminal = terminal; + return this; + } + + /** + * The unique terminal ID. + * @return terminal + **/ + @ApiModelProperty(required = true, value = "The unique terminal ID.") + + public String getTerminal() { + return terminal; + } + + + public void setTerminal(String terminal) { + this.terminal = terminal; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + FindTerminalResponse findTerminalResponse = (FindTerminalResponse) o; + return Objects.equals(this.companyAccount, findTerminalResponse.companyAccount) && + Objects.equals(this.merchantAccount, findTerminalResponse.merchantAccount) && + Objects.equals(this.merchantInventory, findTerminalResponse.merchantInventory) && + Objects.equals(this.store, findTerminalResponse.store) && + Objects.equals(this.terminal, findTerminalResponse.terminal); + } + + @Override + public int hashCode() { + return Objects.hash(companyAccount, merchantAccount, merchantInventory, store, terminal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindTerminalResponse {\n"); + sb.append(" companyAccount: ").append(toIndentedString(companyAccount)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" merchantInventory: ").append(toIndentedString(merchantInventory)).append("\n"); + sb.append(" store: ").append(toIndentedString(store)).append("\n"); + sb.append(" terminal: ").append(toIndentedString(terminal)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("companyAccount"); + openapiFields.add("merchantAccount"); + openapiFields.add("merchantInventory"); + openapiFields.add("store"); + openapiFields.add("terminal"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("companyAccount"); + openapiRequiredFields.add("terminal"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FindTerminalResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FindTerminalResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FindTerminalResponse is not found in the empty JSON string", FindTerminalResponse.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FindTerminalResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FindTerminalResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - return o.toString().replace("\n", "\n "); - } + } + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FindTerminalResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field companyAccount + if (jsonObj.get("companyAccount") != null && !jsonObj.get("companyAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `companyAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyAccount").toString())); + } + // validate the optional field merchantAccount + if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); + } + // validate the optional field store + if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); + } + // validate the optional field terminal + if (jsonObj.get("terminal") != null && !jsonObj.get("terminal").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `terminal` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminal").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!FindTerminalResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FindTerminalResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FindTerminalResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, FindTerminalResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public FindTerminalResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FindTerminalResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of FindTerminalResponse + * @throws IOException if the JSON string is invalid with respect to FindTerminalResponse + */ + public static FindTerminalResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FindTerminalResponse.class); + } + + /** + * Convert an instance of FindTerminalResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountRequest.java b/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountRequest.java old mode 100755 new mode 100644 index 32d3105ef..da8d837d2 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountRequest.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountRequest.java @@ -1,117 +1,250 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. * - * Adyen Java API Library + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.posterminalmanagement; import java.util.Objects; - +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.posterminalmanagement.JSON; /** * GetStoresUnderAccountRequest */ public class GetStoresUnderAccountRequest { - @SerializedName("companyAccount") - private String companyAccount = null; + public static final String SERIALIZED_NAME_COMPANY_ACCOUNT = "companyAccount"; + @SerializedName(SERIALIZED_NAME_COMPANY_ACCOUNT) + private String companyAccount; - @SerializedName("merchantAccount") - private String merchantAccount = null; + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT = "merchantAccount"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) + private String merchantAccount; - public GetStoresUnderAccountRequest companyAccount(String companyAccount) { - this.companyAccount = companyAccount; - return this; - } + public GetStoresUnderAccountRequest() { + } - /** - * The company account. If you only specify this parameter, the response includes the stores of all merchant accounts that are associated with the company account. - * - * @return companyAccount - **/ - public String getCompanyAccount() { - return companyAccount; - } + public GetStoresUnderAccountRequest companyAccount(String companyAccount) { + + this.companyAccount = companyAccount; + return this; + } - public void setCompanyAccount(String companyAccount) { - this.companyAccount = companyAccount; - } + /** + * The company account. If you only specify this parameter, the response includes the stores of all merchant accounts that are associated with the company account. + * @return companyAccount + **/ + @ApiModelProperty(required = true, value = "The company account. If you only specify this parameter, the response includes the stores of all merchant accounts that are associated with the company account.") - public GetStoresUnderAccountRequest merchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - return this; - } + public String getCompanyAccount() { + return companyAccount; + } - /** - * The merchant account. With this parameter, the response only includes the stores of the specified merchant account. - * - * @return merchantAccount - **/ - public String getMerchantAccount() { - return merchantAccount; - } - public void setMerchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - } + public void setCompanyAccount(String companyAccount) { + this.companyAccount = companyAccount; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetStoresUnderAccountRequest getStoresUnderAccountRequest = (GetStoresUnderAccountRequest) o; - return Objects.equals(this.companyAccount, getStoresUnderAccountRequest.companyAccount) && - Objects.equals(this.merchantAccount, getStoresUnderAccountRequest.merchantAccount); - } + public GetStoresUnderAccountRequest merchantAccount(String merchantAccount) { + + this.merchantAccount = merchantAccount; + return this; + } - @Override - public int hashCode() { - return Objects.hash(companyAccount, merchantAccount); - } + /** + * The merchant account. With this parameter, the response only includes the stores of the specified merchant account. + * @return merchantAccount + **/ + @ApiModelProperty(value = "The merchant account. With this parameter, the response only includes the stores of the specified merchant account.") + public String getMerchantAccount() { + return merchantAccount; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetStoresUnderAccountRequest {\n"); - - sb.append(" companyAccount: ").append(toIndentedString(companyAccount)).append("\n"); - sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); - sb.append("}"); - return sb.toString(); + + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetStoresUnderAccountRequest getStoresUnderAccountRequest = (GetStoresUnderAccountRequest) o; + return Objects.equals(this.companyAccount, getStoresUnderAccountRequest.companyAccount) && + Objects.equals(this.merchantAccount, getStoresUnderAccountRequest.merchantAccount); + } + + @Override + public int hashCode() { + return Objects.hash(companyAccount, merchantAccount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetStoresUnderAccountRequest {\n"); + sb.append(" companyAccount: ").append(toIndentedString(companyAccount)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("companyAccount"); + openapiFields.add("merchantAccount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("companyAccount"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetStoresUnderAccountRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GetStoresUnderAccountRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GetStoresUnderAccountRequest is not found in the empty JSON string", GetStoresUnderAccountRequest.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetStoresUnderAccountRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetStoresUnderAccountRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - return o.toString().replace("\n", "\n "); - } + } + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetStoresUnderAccountRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field companyAccount + if (jsonObj.get("companyAccount") != null && !jsonObj.get("companyAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `companyAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyAccount").toString())); + } + // validate the optional field merchantAccount + if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetStoresUnderAccountRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetStoresUnderAccountRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetStoresUnderAccountRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetStoresUnderAccountRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetStoresUnderAccountRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetStoresUnderAccountRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetStoresUnderAccountRequest + * @throws IOException if the JSON string is invalid with respect to GetStoresUnderAccountRequest + */ + public static GetStoresUnderAccountRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetStoresUnderAccountRequest.class); + } + + /** + * Convert an instance of GetStoresUnderAccountRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountResponse.java b/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountResponse.java old mode 100755 new mode 100644 index 5070e53fc..42ba1401e --- a/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountResponse.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountResponse.java @@ -1,105 +1,228 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. * - * Adyen Java API Library + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.posterminalmanagement; import java.util.Objects; - +import java.util.Arrays; +import com.adyen.model.posterminalmanagement.Store; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; - +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.posterminalmanagement.JSON; + /** * GetStoresUnderAccountResponse */ public class GetStoresUnderAccountResponse { - @SerializedName("stores") - private List stores = null; - - public GetStoresUnderAccountResponse stores(List stores) { - this.stores = stores; - return this; - } - - public GetStoresUnderAccountResponse addStoresItem(Store storesItem) { - if (this.stores == null) { - this.stores = new ArrayList(); - } - this.stores.add(storesItem); - return this; - } - - /** - * Array that returns a list of all stores for the specified merchant account, or for all merchant accounts under the company account. - * - * @return stores - **/ - public List getStores() { - return stores; + public static final String SERIALIZED_NAME_STORES = "stores"; + @SerializedName(SERIALIZED_NAME_STORES) + private List stores = null; + + public GetStoresUnderAccountResponse() { + } + + public GetStoresUnderAccountResponse stores(List stores) { + + this.stores = stores; + return this; + } + + public GetStoresUnderAccountResponse addStoresItem(Store storesItem) { + if (this.stores == null) { + this.stores = new ArrayList<>(); } + this.stores.add(storesItem); + return this; + } - public void setStores(List stores) { - this.stores = stores; - } + /** + * Array that returns a list of all stores for the specified merchant account, or for all merchant accounts under the company account. + * @return stores + **/ + @ApiModelProperty(value = "Array that returns a list of all stores for the specified merchant account, or for all merchant accounts under the company account.") + public List getStores() { + return stores; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetStoresUnderAccountResponse getStoresUnderAccountResponse = (GetStoresUnderAccountResponse) o; - return Objects.equals(this.stores, getStoresUnderAccountResponse.stores); - } - @Override - public int hashCode() { - return Objects.hash(stores); - } + public void setStores(List stores) { + this.stores = stores; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetStoresUnderAccountResponse {\n"); - sb.append(" stores: ").append(toIndentedString(stores)).append("\n"); - sb.append("}"); - return sb.toString(); + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetStoresUnderAccountResponse getStoresUnderAccountResponse = (GetStoresUnderAccountResponse) o; + return Objects.equals(this.stores, getStoresUnderAccountResponse.stores); + } + + @Override + public int hashCode() { + return Objects.hash(stores); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetStoresUnderAccountResponse {\n"); + sb.append(" stores: ").append(toIndentedString(stores)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("stores"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetStoresUnderAccountResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GetStoresUnderAccountResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GetStoresUnderAccountResponse is not found in the empty JSON string", GetStoresUnderAccountResponse.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetStoresUnderAccountResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetStoresUnderAccountResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - return o.toString().replace("\n", "\n "); - } + } + JsonArray jsonArraystores = jsonObj.getAsJsonArray("stores"); + if (jsonArraystores != null) { + // ensure the json data is an array + if (!jsonObj.get("stores").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stores` to be an array in the JSON string but got `%s`", jsonObj.get("stores").toString())); + } + + // validate the optional field `stores` (array) + for (int i = 0; i < jsonArraystores.size(); i++) { + Store.validateJsonObject(jsonArraystores.get(i).getAsJsonObject()); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetStoresUnderAccountResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetStoresUnderAccountResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetStoresUnderAccountResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetStoresUnderAccountResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetStoresUnderAccountResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetStoresUnderAccountResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetStoresUnderAccountResponse + * @throws IOException if the JSON string is invalid with respect to GetStoresUnderAccountResponse + */ + public static GetStoresUnderAccountResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetStoresUnderAccountResponse.class); + } + + /** + * Convert an instance of GetStoresUnderAccountResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsRequest.java b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsRequest.java old mode 100755 new mode 100644 index 7350ba356..d20cd8c32 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsRequest.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsRequest.java @@ -1,94 +1,217 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. * - * Adyen Java API Library + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.posterminalmanagement; import java.util.Objects; - +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.posterminalmanagement.JSON; /** * GetTerminalDetailsRequest */ public class GetTerminalDetailsRequest { - @SerializedName("terminal") - private String terminal = null; + public static final String SERIALIZED_NAME_TERMINAL = "terminal"; + @SerializedName(SERIALIZED_NAME_TERMINAL) + private String terminal; - public GetTerminalDetailsRequest terminal(String terminal) { - this.terminal = terminal; - return this; - } + public GetTerminalDetailsRequest() { + } - /** - * The unique terminal ID in the format `[Device model]-[Serial number]`. For example, **V400m-324689776**. - * - * @return terminal - **/ - public String getTerminal() { - return terminal; - } + public GetTerminalDetailsRequest terminal(String terminal) { + + this.terminal = terminal; + return this; + } - public void setTerminal(String terminal) { - this.terminal = terminal; - } + /** + * The unique terminal ID in the format `[Device model]-[Serial number]`. For example, **V400m-324689776**. + * @return terminal + **/ + @ApiModelProperty(required = true, value = "The unique terminal ID in the format `[Device model]-[Serial number]`. For example, **V400m-324689776**.") + public String getTerminal() { + return terminal; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetTerminalDetailsRequest getTerminalDetailsRequest = (GetTerminalDetailsRequest) o; - return Objects.equals(this.terminal, getTerminalDetailsRequest.terminal); - } - @Override - public int hashCode() { - return Objects.hash(terminal); - } + public void setTerminal(String terminal) { + this.terminal = terminal; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTerminalDetailsRequest {\n"); - sb.append(" terminal: ").append(toIndentedString(terminal)).append("\n"); - sb.append("}"); - return sb.toString(); + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } + GetTerminalDetailsRequest getTerminalDetailsRequest = (GetTerminalDetailsRequest) o; + return Objects.equals(this.terminal, getTerminalDetailsRequest.terminal); + } + + @Override + public int hashCode() { + return Objects.hash(terminal); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTerminalDetailsRequest {\n"); + sb.append(" terminal: ").append(toIndentedString(terminal)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("terminal"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("terminal"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTerminalDetailsRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GetTerminalDetailsRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GetTerminalDetailsRequest is not found in the empty JSON string", GetTerminalDetailsRequest.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTerminalDetailsRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTerminalDetailsRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - return o.toString().replace("\n", "\n "); - } + } + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTerminalDetailsRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field terminal + if (jsonObj.get("terminal") != null && !jsonObj.get("terminal").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `terminal` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminal").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTerminalDetailsRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTerminalDetailsRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetTerminalDetailsRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTerminalDetailsRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTerminalDetailsRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetTerminalDetailsRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTerminalDetailsRequest + * @throws IOException if the JSON string is invalid with respect to GetTerminalDetailsRequest + */ + public static GetTerminalDetailsRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTerminalDetailsRequest.class); + } + + /** + * Convert an instance of GetTerminalDetailsRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsResponse.java b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsResponse.java old mode 100755 new mode 100644 index 8f6da6651..b15e54713 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsResponse.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsResponse.java @@ -1,709 +1,1066 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. * - * Adyen Java API Library + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.posterminalmanagement; import java.util.Objects; - +import java.util.Arrays; +import com.adyen.model.posterminalmanagement.Store; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; - +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.time.OffsetDateTime; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.posterminalmanagement.JSON; /** * GetTerminalDetailsResponse */ public class GetTerminalDetailsResponse { - @SerializedName("bluetoothIp") - private String bluetoothIp = null; + public static final String SERIALIZED_NAME_BLUETOOTH_IP = "bluetoothIp"; + @SerializedName(SERIALIZED_NAME_BLUETOOTH_IP) + private String bluetoothIp; + + public static final String SERIALIZED_NAME_BLUETOOTH_MAC = "bluetoothMac"; + @SerializedName(SERIALIZED_NAME_BLUETOOTH_MAC) + private String bluetoothMac; + + public static final String SERIALIZED_NAME_COMPANY_ACCOUNT = "companyAccount"; + @SerializedName(SERIALIZED_NAME_COMPANY_ACCOUNT) + private String companyAccount; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public static final String SERIALIZED_NAME_DEVICE_MODEL = "deviceModel"; + @SerializedName(SERIALIZED_NAME_DEVICE_MODEL) + private String deviceModel; + + public static final String SERIALIZED_NAME_DHCP_ENABLED = "dhcpEnabled"; + @SerializedName(SERIALIZED_NAME_DHCP_ENABLED) + private Boolean dhcpEnabled; + + public static final String SERIALIZED_NAME_DISPLAY_LABEL = "displayLabel"; + @SerializedName(SERIALIZED_NAME_DISPLAY_LABEL) + private String displayLabel; + + public static final String SERIALIZED_NAME_ETHERNET_IP = "ethernetIp"; + @SerializedName(SERIALIZED_NAME_ETHERNET_IP) + private String ethernetIp; + + public static final String SERIALIZED_NAME_ETHERNET_MAC = "ethernetMac"; + @SerializedName(SERIALIZED_NAME_ETHERNET_MAC) + private String ethernetMac; + + public static final String SERIALIZED_NAME_FIRMWARE_VERSION = "firmwareVersion"; + @SerializedName(SERIALIZED_NAME_FIRMWARE_VERSION) + private String firmwareVersion; + + public static final String SERIALIZED_NAME_ICCID = "iccid"; + @SerializedName(SERIALIZED_NAME_ICCID) + private String iccid; + + public static final String SERIALIZED_NAME_LAST_ACTIVITY_DATE_TIME = "lastActivityDateTime"; + @SerializedName(SERIALIZED_NAME_LAST_ACTIVITY_DATE_TIME) + private OffsetDateTime lastActivityDateTime; + + public static final String SERIALIZED_NAME_LAST_TRANSACTION_DATE_TIME = "lastTransactionDateTime"; + @SerializedName(SERIALIZED_NAME_LAST_TRANSACTION_DATE_TIME) + private OffsetDateTime lastTransactionDateTime; + + public static final String SERIALIZED_NAME_LINK_NEGOTIATION = "linkNegotiation"; + @SerializedName(SERIALIZED_NAME_LINK_NEGOTIATION) + private String linkNegotiation; + + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT = "merchantAccount"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) + private String merchantAccount; + + public static final String SERIALIZED_NAME_MERCHANT_INVENTORY = "merchantInventory"; + @SerializedName(SERIALIZED_NAME_MERCHANT_INVENTORY) + private Boolean merchantInventory; + + public static final String SERIALIZED_NAME_PERMANENT_TERMINAL_ID = "permanentTerminalId"; + @SerializedName(SERIALIZED_NAME_PERMANENT_TERMINAL_ID) + private String permanentTerminalId; + + public static final String SERIALIZED_NAME_SERIAL_NUMBER = "serialNumber"; + @SerializedName(SERIALIZED_NAME_SERIAL_NUMBER) + private String serialNumber; + + public static final String SERIALIZED_NAME_SIM_STATUS = "simStatus"; + @SerializedName(SERIALIZED_NAME_SIM_STATUS) + private String simStatus; + + public static final String SERIALIZED_NAME_STORE = "store"; + @SerializedName(SERIALIZED_NAME_STORE) + private String store; + + public static final String SERIALIZED_NAME_STORE_DETAILS = "storeDetails"; + @SerializedName(SERIALIZED_NAME_STORE_DETAILS) + private Store storeDetails; + + public static final String SERIALIZED_NAME_TERMINAL = "terminal"; + @SerializedName(SERIALIZED_NAME_TERMINAL) + private String terminal; + + /** + * The status of the terminal: - `OnlineToday`, `OnlineLast1Day`, `OnlineLast2Days` etcetera to `OnlineLast7Days`: Indicates when in the past week the terminal was last online. - `SwitchedOff`: Indicates it was more than a week ago that the terminal was last online. - `ReAssignToInventoryPending`, `ReAssignToStorePending`, `ReAssignToMerchantInventoryPending`: Indicates the terminal is scheduled to be reassigned. + */ + @JsonAdapter(TerminalStatusEnum.Adapter.class) + public enum TerminalStatusEnum { + ONLINELAST1DAY("OnlineLast1Day"), + + ONLINELAST2DAYS("OnlineLast2Days"), + + ONLINELAST3DAYS("OnlineLast3Days"), + + ONLINELAST4DAYS("OnlineLast4Days"), + + ONLINELAST5DAYS("OnlineLast5Days"), + + ONLINELAST6DAYS("OnlineLast6Days"), + + ONLINELAST7DAYS("OnlineLast7Days"), + + ONLINETODAY("OnlineToday"), + + REASSIGNTOINVENTORYPENDING("ReAssignToInventoryPending"), + + REASSIGNTOMERCHANTINVENTORYPENDING("ReAssignToMerchantInventoryPending"), + + REASSIGNTOSTOREPENDING("ReAssignToStorePending"), + + SWITCHEDOFF("SwitchedOff"); + + private String value; + + TerminalStatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } - @SerializedName("bluetoothMac") - private String bluetoothMac = null; + @Override + public String toString() { + return String.valueOf(value); + } - @SerializedName("companyAccount") - private String companyAccount = null; + public static TerminalStatusEnum fromValue(String value) { + for (TerminalStatusEnum b : TerminalStatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } - @SerializedName("country") - private String country = null; + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TerminalStatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } - @SerializedName("deviceModel") - private String deviceModel = null; + @Override + public TerminalStatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TerminalStatusEnum.fromValue(value); + } + } + } - @SerializedName("dhcpEnabled") - private Boolean dhcpEnabled = null; + public static final String SERIALIZED_NAME_TERMINAL_STATUS = "terminalStatus"; + @SerializedName(SERIALIZED_NAME_TERMINAL_STATUS) + private TerminalStatusEnum terminalStatus; - @SerializedName("displayLabel") - private String displayLabel = null; + public static final String SERIALIZED_NAME_WIFI_IP = "wifiIp"; + @SerializedName(SERIALIZED_NAME_WIFI_IP) + private String wifiIp; - @SerializedName("ethernetIp") - private String ethernetIp = null; + public static final String SERIALIZED_NAME_WIFI_MAC = "wifiMac"; + @SerializedName(SERIALIZED_NAME_WIFI_MAC) + private String wifiMac; - @SerializedName("ethernetMac") - private String ethernetMac = null; + public GetTerminalDetailsResponse() { + } - @SerializedName("firmwareVersion") - private String firmwareVersion = null; + public GetTerminalDetailsResponse bluetoothIp(String bluetoothIp) { + + this.bluetoothIp = bluetoothIp; + return this; + } - @SerializedName("iccid") - private String iccid = null; + /** + * The Bluetooth IP address of the terminal. + * @return bluetoothIp + **/ + @ApiModelProperty(value = "The Bluetooth IP address of the terminal.") - @SerializedName("lastActivityDateTime") - private String lastActivityDateTime = null; + public String getBluetoothIp() { + return bluetoothIp; + } - @SerializedName("lastTransactionDateTime") - private String lastTransactionDateTime = null; - @SerializedName("linkNegotiation") - private String linkNegotiation = null; + public void setBluetoothIp(String bluetoothIp) { + this.bluetoothIp = bluetoothIp; + } - @SerializedName("merchantAccount") - private String merchantAccount = null; - @SerializedName("merchantInventory") - private Boolean merchantInventory = null; + public GetTerminalDetailsResponse bluetoothMac(String bluetoothMac) { + + this.bluetoothMac = bluetoothMac; + return this; + } - @SerializedName("permanentTerminalId") - private String permanentTerminalId = null; + /** + * The Bluetooth MAC address of the terminal. + * @return bluetoothMac + **/ + @ApiModelProperty(value = "The Bluetooth MAC address of the terminal.") - @SerializedName("serialNumber") - private String serialNumber = null; + public String getBluetoothMac() { + return bluetoothMac; + } - @SerializedName("simStatus") - private String simStatus = null; - @SerializedName("store") - private String store = null; + public void setBluetoothMac(String bluetoothMac) { + this.bluetoothMac = bluetoothMac; + } - @SerializedName("storeDetails") - private Store storeDetails = null; - @SerializedName("terminal") - private String terminal = null; + public GetTerminalDetailsResponse companyAccount(String companyAccount) { + + this.companyAccount = companyAccount; + return this; + } - /** - * The status of the terminal: - `OnlineToday`, `OnlineLast1Day`, `OnlineLast2Days` etcetera to `OnlineLast7Days`: Indicates when in the past week the terminal was last online. - `SwitchedOff`: Indicates it was more than a week ago that the terminal was last online. - `ReAssignToInventoryPending`, `ReAssignToStorePending`, `ReAssignToMerchantInventoryPending`: Indicates the terminal is scheduled to be reassigned. - */ - @JsonAdapter(TerminalStatusEnum.Adapter.class) - public enum TerminalStatusEnum { - ONLINELAST1DAY("OnlineLast1Day"), - ONLINELAST2DAYS("OnlineLast2Days"), - ONLINELAST3DAYS("OnlineLast3Days"), - ONLINELAST4DAYS("OnlineLast4Days"), - ONLINELAST5DAYS("OnlineLast5Days"), - ONLINELAST6DAYS("OnlineLast6Days"), - ONLINELAST7DAYS("OnlineLast7Days"), - ONLINETODAY("OnlineToday"), - REASSIGNTOINVENTORYPENDING("ReAssignToInventoryPending"), - REASSIGNTOMERCHANTINVENTORYPENDING("ReAssignToMerchantInventoryPending"), - REASSIGNTOSTOREPENDING("ReAssignToStorePending"), - SWITCHEDOFF("SwitchedOff"); + /** + * The company account that the terminal is associated with. If this is the only account level shown in the response, the terminal is assigned to the inventory of the company account. + * @return companyAccount + **/ + @ApiModelProperty(required = true, value = "The company account that the terminal is associated with. If this is the only account level shown in the response, the terminal is assigned to the inventory of the company account.") + public String getCompanyAccount() { + return companyAccount; + } - private final String value; - TerminalStatusEnum(String value) { - this.value = value; - } + public void setCompanyAccount(String companyAccount) { + this.companyAccount = companyAccount; + } - public String getValue() { - return value; - } - @Override - public String toString() { - return String.valueOf(value); - } + public GetTerminalDetailsResponse country(String country) { + + this.country = country; + return this; + } - public static TerminalStatusEnum fromValue(String text) { - for (TerminalStatusEnum b : TerminalStatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } + /** + * The country where the terminal is used. + * @return country + **/ + @ApiModelProperty(value = "The country where the terminal is used.") - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TerminalStatusEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TerminalStatusEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TerminalStatusEnum.fromValue(String.valueOf(value)); - } - } - } + public String getCountry() { + return country; + } - @SerializedName("terminalStatus") - private TerminalStatusEnum terminalStatus = null; - @SerializedName("wifiIp") - private String wifiIp = null; + public void setCountry(String country) { + this.country = country; + } - @SerializedName("wifiMac") - private String wifiMac = null; - public GetTerminalDetailsResponse bluetoothIp(String bluetoothIp) { - this.bluetoothIp = bluetoothIp; - return this; - } + public GetTerminalDetailsResponse deviceModel(String deviceModel) { + + this.deviceModel = deviceModel; + return this; + } - /** - * The Bluetooth IP address of the terminal. - * - * @return bluetoothIp - **/ - public String getBluetoothIp() { - return bluetoothIp; - } + /** + * The model name of the terminal. + * @return deviceModel + **/ + @ApiModelProperty(value = "The model name of the terminal.") - public void setBluetoothIp(String bluetoothIp) { - this.bluetoothIp = bluetoothIp; - } + public String getDeviceModel() { + return deviceModel; + } - public GetTerminalDetailsResponse bluetoothMac(String bluetoothMac) { - this.bluetoothMac = bluetoothMac; - return this; - } - /** - * The Bluetooth MAC address of the terminal. - * - * @return bluetoothMac - **/ - public String getBluetoothMac() { - return bluetoothMac; - } + public void setDeviceModel(String deviceModel) { + this.deviceModel = deviceModel; + } - public void setBluetoothMac(String bluetoothMac) { - this.bluetoothMac = bluetoothMac; - } - public GetTerminalDetailsResponse companyAccount(String companyAccount) { - this.companyAccount = companyAccount; - return this; - } + public GetTerminalDetailsResponse dhcpEnabled(Boolean dhcpEnabled) { + + this.dhcpEnabled = dhcpEnabled; + return this; + } - /** - * The company account that the terminal is associated with. If this is the only account level shown in the response, the terminal is assigned to the inventory of the company account. - * - * @return companyAccount - **/ - public String getCompanyAccount() { - return companyAccount; - } + /** + * Indicates whether assigning IP addresses through a DHCP server is enabled on the terminal. + * @return dhcpEnabled + **/ + @ApiModelProperty(value = "Indicates whether assigning IP addresses through a DHCP server is enabled on the terminal.") - public void setCompanyAccount(String companyAccount) { - this.companyAccount = companyAccount; - } + public Boolean getDhcpEnabled() { + return dhcpEnabled; + } - public GetTerminalDetailsResponse country(String country) { - this.country = country; - return this; - } - /** - * The country where the terminal is used. - * - * @return country - **/ - public String getCountry() { - return country; - } + public void setDhcpEnabled(Boolean dhcpEnabled) { + this.dhcpEnabled = dhcpEnabled; + } - public void setCountry(String country) { - this.country = country; - } - public GetTerminalDetailsResponse deviceModel(String deviceModel) { - this.deviceModel = deviceModel; - return this; - } + public GetTerminalDetailsResponse displayLabel(String displayLabel) { + + this.displayLabel = displayLabel; + return this; + } - /** - * The model name of the terminal. - * - * @return deviceModel - **/ - public String getDeviceModel() { - return deviceModel; - } + /** + * The label shown on the status bar of the display. This label (if any) is specified in your Customer Area. + * @return displayLabel + **/ + @ApiModelProperty(value = "The label shown on the status bar of the display. This label (if any) is specified in your Customer Area.") - public void setDeviceModel(String deviceModel) { - this.deviceModel = deviceModel; - } + public String getDisplayLabel() { + return displayLabel; + } - public GetTerminalDetailsResponse dhcpEnabled(Boolean dhcpEnabled) { - this.dhcpEnabled = dhcpEnabled; - return this; - } - /** - * Indicates whether assigning IP addresses through a DHCP server is enabled on the terminal. - * - * @return dhcpEnabled - **/ - public Boolean isDhcpEnabled() { - return dhcpEnabled; - } + public void setDisplayLabel(String displayLabel) { + this.displayLabel = displayLabel; + } - public void setDhcpEnabled(Boolean dhcpEnabled) { - this.dhcpEnabled = dhcpEnabled; - } - public GetTerminalDetailsResponse displayLabel(String displayLabel) { - this.displayLabel = displayLabel; - return this; - } + public GetTerminalDetailsResponse ethernetIp(String ethernetIp) { + + this.ethernetIp = ethernetIp; + return this; + } - /** - * The label shown on the status bar of the display. This label (if any) is specified in your Customer Area. - * - * @return displayLabel - **/ - public String getDisplayLabel() { - return displayLabel; - } + /** + * The terminal's IP address in your Ethernet network. + * @return ethernetIp + **/ + @ApiModelProperty(value = "The terminal's IP address in your Ethernet network.") - public void setDisplayLabel(String displayLabel) { - this.displayLabel = displayLabel; - } + public String getEthernetIp() { + return ethernetIp; + } - public GetTerminalDetailsResponse ethernetIp(String ethernetIp) { - this.ethernetIp = ethernetIp; - return this; - } - /** - * The terminal's IP address in your Ethernet network. - * - * @return ethernetIp - **/ - public String getEthernetIp() { - return ethernetIp; - } + public void setEthernetIp(String ethernetIp) { + this.ethernetIp = ethernetIp; + } - public void setEthernetIp(String ethernetIp) { - this.ethernetIp = ethernetIp; - } - public GetTerminalDetailsResponse ethernetMac(String ethernetMac) { - this.ethernetMac = ethernetMac; - return this; - } + public GetTerminalDetailsResponse ethernetMac(String ethernetMac) { + + this.ethernetMac = ethernetMac; + return this; + } - /** - * The terminal's MAC address in your Ethernet network. - * - * @return ethernetMac - **/ - public String getEthernetMac() { - return ethernetMac; - } + /** + * The terminal's MAC address in your Ethernet network. + * @return ethernetMac + **/ + @ApiModelProperty(value = "The terminal's MAC address in your Ethernet network.") - public void setEthernetMac(String ethernetMac) { - this.ethernetMac = ethernetMac; - } + public String getEthernetMac() { + return ethernetMac; + } - public GetTerminalDetailsResponse firmwareVersion(String firmwareVersion) { - this.firmwareVersion = firmwareVersion; - return this; - } - /** - * The software release currently in use on the terminal. - * - * @return firmwareVersion - **/ - public String getFirmwareVersion() { - return firmwareVersion; - } + public void setEthernetMac(String ethernetMac) { + this.ethernetMac = ethernetMac; + } - public void setFirmwareVersion(String firmwareVersion) { - this.firmwareVersion = firmwareVersion; - } - public GetTerminalDetailsResponse iccid(String iccid) { - this.iccid = iccid; - return this; - } + public GetTerminalDetailsResponse firmwareVersion(String firmwareVersion) { + + this.firmwareVersion = firmwareVersion; + return this; + } - /** - * The integrated circuit card identifier (ICCID) of the SIM card in the terminal. - * - * @return iccid - **/ - public String getIccid() { - return iccid; - } + /** + * The software release currently in use on the terminal. + * @return firmwareVersion + **/ + @ApiModelProperty(value = "The software release currently in use on the terminal.") - public void setIccid(String iccid) { - this.iccid = iccid; - } + public String getFirmwareVersion() { + return firmwareVersion; + } - public GetTerminalDetailsResponse lastActivityDateTime(String lastActivityDateTime) { - this.lastActivityDateTime = lastActivityDateTime; - return this; - } - /** - * Date and time of the last activity on the terminal. Not included when the last activity was more than 14 days ago. - * - * @return lastActivityDateTime - **/ - public String getLastActivityDateTime() { - return lastActivityDateTime; - } + public void setFirmwareVersion(String firmwareVersion) { + this.firmwareVersion = firmwareVersion; + } - public void setLastActivityDateTime(String lastActivityDateTime) { - this.lastActivityDateTime = lastActivityDateTime; - } - public GetTerminalDetailsResponse lastTransactionDateTime(String lastTransactionDateTime) { - this.lastTransactionDateTime = lastTransactionDateTime; - return this; - } + public GetTerminalDetailsResponse iccid(String iccid) { + + this.iccid = iccid; + return this; + } - /** - * Date and time of the last transaction on the terminal. Not included when the last transaction was more than 14 days ago. - * - * @return lastTransactionDateTime - **/ - public String getLastTransactionDateTime() { - return lastTransactionDateTime; - } + /** + * The integrated circuit card identifier (ICCID) of the SIM card in the terminal. + * @return iccid + **/ + @ApiModelProperty(value = "The integrated circuit card identifier (ICCID) of the SIM card in the terminal.") - public void setLastTransactionDateTime(String lastTransactionDateTime) { - this.lastTransactionDateTime = lastTransactionDateTime; - } + public String getIccid() { + return iccid; + } - public GetTerminalDetailsResponse linkNegotiation(String linkNegotiation) { - this.linkNegotiation = linkNegotiation; - return this; - } - /** - * The Ethernet link negotiation that the terminal uses: - `auto`: Auto-negotiation - `100full`: 100 Mbps full duplex - * - * @return linkNegotiation - **/ - public String getLinkNegotiation() { - return linkNegotiation; - } + public void setIccid(String iccid) { + this.iccid = iccid; + } - public void setLinkNegotiation(String linkNegotiation) { - this.linkNegotiation = linkNegotiation; - } - public GetTerminalDetailsResponse merchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - return this; - } + public GetTerminalDetailsResponse lastActivityDateTime(OffsetDateTime lastActivityDateTime) { + + this.lastActivityDateTime = lastActivityDateTime; + return this; + } - /** - * The merchant account that the terminal is associated with. If the response doesn't contain a `store` the terminal is assigned to this merchant account. - * - * @return merchantAccount - **/ - public String getMerchantAccount() { - return merchantAccount; - } + /** + * Date and time of the last activity on the terminal. Not included when the last activity was more than 14 days ago. + * @return lastActivityDateTime + **/ + @ApiModelProperty(value = "Date and time of the last activity on the terminal. Not included when the last activity was more than 14 days ago.") - public void setMerchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - } + public OffsetDateTime getLastActivityDateTime() { + return lastActivityDateTime; + } - public GetTerminalDetailsResponse merchantInventory(Boolean merchantInventory) { - this.merchantInventory = merchantInventory; - return this; - } - /** - * Boolean that indicates if the terminal is assigned to the merchant inventory. This is returned when the terminal is assigned to a merchant account. - If **true**, this indicates that the terminal is in the merchant inventory. This also means that the terminal cannot be boarded. - If **false**, this indicates that the terminal is assigned to the merchant account as an in-store terminal. This means that the terminal is ready to be boarded, or is already boarded. - * - * @return merchantInventory - **/ - public Boolean isMerchantInventory() { - return merchantInventory; - } + public void setLastActivityDateTime(OffsetDateTime lastActivityDateTime) { + this.lastActivityDateTime = lastActivityDateTime; + } - public void setMerchantInventory(Boolean merchantInventory) { - this.merchantInventory = merchantInventory; - } - public GetTerminalDetailsResponse permanentTerminalId(String permanentTerminalId) { - this.permanentTerminalId = permanentTerminalId; - return this; - } + public GetTerminalDetailsResponse lastTransactionDateTime(OffsetDateTime lastTransactionDateTime) { + + this.lastTransactionDateTime = lastTransactionDateTime; + return this; + } - /** - * The permanent terminal ID. - * - * @return permanentTerminalId - **/ - public String getPermanentTerminalId() { - return permanentTerminalId; - } + /** + * Date and time of the last transaction on the terminal. Not included when the last transaction was more than 14 days ago. + * @return lastTransactionDateTime + **/ + @ApiModelProperty(value = "Date and time of the last transaction on the terminal. Not included when the last transaction was more than 14 days ago.") - public void setPermanentTerminalId(String permanentTerminalId) { - this.permanentTerminalId = permanentTerminalId; - } + public OffsetDateTime getLastTransactionDateTime() { + return lastTransactionDateTime; + } - public GetTerminalDetailsResponse serialNumber(String serialNumber) { - this.serialNumber = serialNumber; - return this; - } - /** - * The serial number of the terminal. - * - * @return serialNumber - **/ - public String getSerialNumber() { - return serialNumber; - } + public void setLastTransactionDateTime(OffsetDateTime lastTransactionDateTime) { + this.lastTransactionDateTime = lastTransactionDateTime; + } - public void setSerialNumber(String serialNumber) { - this.serialNumber = serialNumber; - } - public GetTerminalDetailsResponse simStatus(String simStatus) { - this.simStatus = simStatus; - return this; - } + public GetTerminalDetailsResponse linkNegotiation(String linkNegotiation) { + + this.linkNegotiation = linkNegotiation; + return this; + } - /** - * On a terminal that supports 3G or 4G connectivity, indicates the status of the SIM card in the terminal: ACTIVE or INVENTORY. - * - * @return simStatus - **/ - public String getSimStatus() { - return simStatus; - } + /** + * The Ethernet link negotiation that the terminal uses: - `auto`: Auto-negotiation - `100full`: 100 Mbps full duplex + * @return linkNegotiation + **/ + @ApiModelProperty(value = "The Ethernet link negotiation that the terminal uses: - `auto`: Auto-negotiation - `100full`: 100 Mbps full duplex") - public void setSimStatus(String simStatus) { - this.simStatus = simStatus; - } + public String getLinkNegotiation() { + return linkNegotiation; + } - public GetTerminalDetailsResponse store(String store) { - this.store = store; - return this; - } - /** - * The store code of the store that the terminal is assigned to. - * - * @return store - **/ - public String getStore() { - return store; - } + public void setLinkNegotiation(String linkNegotiation) { + this.linkNegotiation = linkNegotiation; + } - public void setStore(String store) { - this.store = store; - } - public GetTerminalDetailsResponse storeDetails(Store storeDetails) { - this.storeDetails = storeDetails; - return this; - } + public GetTerminalDetailsResponse merchantAccount(String merchantAccount) { + + this.merchantAccount = merchantAccount; + return this; + } - /** - * Get storeDetails - * - * @return storeDetails - **/ - public Store getStoreDetails() { - return storeDetails; - } + /** + * The merchant account that the terminal is associated with. If the response doesn't contain a `store` the terminal is assigned to this merchant account. + * @return merchantAccount + **/ + @ApiModelProperty(value = "The merchant account that the terminal is associated with. If the response doesn't contain a `store` the terminal is assigned to this merchant account.") - public void setStoreDetails(Store storeDetails) { - this.storeDetails = storeDetails; - } + public String getMerchantAccount() { + return merchantAccount; + } - public GetTerminalDetailsResponse terminal(String terminal) { - this.terminal = terminal; - return this; - } - /** - * The unique terminal ID. - * - * @return terminal - **/ - public String getTerminal() { - return terminal; - } + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } - public void setTerminal(String terminal) { - this.terminal = terminal; - } - public GetTerminalDetailsResponse terminalStatus(TerminalStatusEnum terminalStatus) { - this.terminalStatus = terminalStatus; - return this; - } + public GetTerminalDetailsResponse merchantInventory(Boolean merchantInventory) { + + this.merchantInventory = merchantInventory; + return this; + } - /** - * The status of the terminal: - `OnlineToday`, `OnlineLast1Day`, `OnlineLast2Days` etcetera to `OnlineLast7Days`: Indicates when in the past week the terminal was last online. - `SwitchedOff`: Indicates it was more than a week ago that the terminal was last online. - `ReAssignToInventoryPending`, `ReAssignToStorePending`, `ReAssignToMerchantInventoryPending`: Indicates the terminal is scheduled to be reassigned. - * - * @return terminalStatus - **/ - public TerminalStatusEnum getTerminalStatus() { - return terminalStatus; - } + /** + * Boolean that indicates if the terminal is assigned to the merchant inventory. This is returned when the terminal is assigned to a merchant account. - If **true**, this indicates that the terminal is in the merchant inventory. This also means that the terminal cannot be boarded. - If **false**, this indicates that the terminal is assigned to the merchant account as an in-store terminal. This means that the terminal is ready to be boarded, or is already boarded. + * @return merchantInventory + **/ + @ApiModelProperty(value = "Boolean that indicates if the terminal is assigned to the merchant inventory. This is returned when the terminal is assigned to a merchant account. - If **true**, this indicates that the terminal is in the merchant inventory. This also means that the terminal cannot be boarded. - If **false**, this indicates that the terminal is assigned to the merchant account as an in-store terminal. This means that the terminal is ready to be boarded, or is already boarded.") - public void setTerminalStatus(TerminalStatusEnum terminalStatus) { - this.terminalStatus = terminalStatus; - } + public Boolean getMerchantInventory() { + return merchantInventory; + } - public GetTerminalDetailsResponse wifiIp(String wifiIp) { - this.wifiIp = wifiIp; - return this; - } - /** - * The terminal's IP address in your Wi-Fi network. - * - * @return wifiIp - **/ - public String getWifiIp() { - return wifiIp; - } + public void setMerchantInventory(Boolean merchantInventory) { + this.merchantInventory = merchantInventory; + } - public void setWifiIp(String wifiIp) { - this.wifiIp = wifiIp; - } - public GetTerminalDetailsResponse wifiMac(String wifiMac) { - this.wifiMac = wifiMac; - return this; - } + public GetTerminalDetailsResponse permanentTerminalId(String permanentTerminalId) { + + this.permanentTerminalId = permanentTerminalId; + return this; + } - /** - * The terminal's MAC address in your Wi-Fi network. - * - * @return wifiMac - **/ - public String getWifiMac() { - return wifiMac; - } + /** + * The permanent terminal ID. + * @return permanentTerminalId + **/ + @ApiModelProperty(value = "The permanent terminal ID.") - public void setWifiMac(String wifiMac) { - this.wifiMac = wifiMac; - } + public String getPermanentTerminalId() { + return permanentTerminalId; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GetTerminalDetailsResponse getTerminalDetailsResponse = (GetTerminalDetailsResponse) o; - return Objects.equals(this.bluetoothIp, getTerminalDetailsResponse.bluetoothIp) && - Objects.equals(this.bluetoothMac, getTerminalDetailsResponse.bluetoothMac) && - Objects.equals(this.companyAccount, getTerminalDetailsResponse.companyAccount) && - Objects.equals(this.country, getTerminalDetailsResponse.country) && - Objects.equals(this.deviceModel, getTerminalDetailsResponse.deviceModel) && - Objects.equals(this.dhcpEnabled, getTerminalDetailsResponse.dhcpEnabled) && - Objects.equals(this.displayLabel, getTerminalDetailsResponse.displayLabel) && - Objects.equals(this.ethernetIp, getTerminalDetailsResponse.ethernetIp) && - Objects.equals(this.ethernetMac, getTerminalDetailsResponse.ethernetMac) && - Objects.equals(this.firmwareVersion, getTerminalDetailsResponse.firmwareVersion) && - Objects.equals(this.iccid, getTerminalDetailsResponse.iccid) && - Objects.equals(this.lastActivityDateTime, getTerminalDetailsResponse.lastActivityDateTime) && - Objects.equals(this.lastTransactionDateTime, getTerminalDetailsResponse.lastTransactionDateTime) && - Objects.equals(this.linkNegotiation, getTerminalDetailsResponse.linkNegotiation) && - Objects.equals(this.merchantAccount, getTerminalDetailsResponse.merchantAccount) && - Objects.equals(this.merchantInventory, getTerminalDetailsResponse.merchantInventory) && - Objects.equals(this.permanentTerminalId, getTerminalDetailsResponse.permanentTerminalId) && - Objects.equals(this.serialNumber, getTerminalDetailsResponse.serialNumber) && - Objects.equals(this.simStatus, getTerminalDetailsResponse.simStatus) && - Objects.equals(this.store, getTerminalDetailsResponse.store) && - Objects.equals(this.storeDetails, getTerminalDetailsResponse.storeDetails) && - Objects.equals(this.terminal, getTerminalDetailsResponse.terminal) && - Objects.equals(this.terminalStatus, getTerminalDetailsResponse.terminalStatus) && - Objects.equals(this.wifiIp, getTerminalDetailsResponse.wifiIp) && - Objects.equals(this.wifiMac, getTerminalDetailsResponse.wifiMac); - } + public void setPermanentTerminalId(String permanentTerminalId) { + this.permanentTerminalId = permanentTerminalId; + } - @Override - public int hashCode() { - return Objects.hash(bluetoothIp, bluetoothMac, companyAccount, country, deviceModel, dhcpEnabled, displayLabel, ethernetIp, ethernetMac, firmwareVersion, iccid, lastActivityDateTime, lastTransactionDateTime, linkNegotiation, merchantAccount, merchantInventory, permanentTerminalId, serialNumber, simStatus, store, storeDetails, terminal, terminalStatus, wifiIp, wifiMac); - } + public GetTerminalDetailsResponse serialNumber(String serialNumber) { + + this.serialNumber = serialNumber; + return this; + } + + /** + * The serial number of the terminal. + * @return serialNumber + **/ + @ApiModelProperty(value = "The serial number of the terminal.") + + public String getSerialNumber() { + return serialNumber; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTerminalDetailsResponse {\n"); - - sb.append(" bluetoothIp: ").append(toIndentedString(bluetoothIp)).append("\n"); - sb.append(" bluetoothMac: ").append(toIndentedString(bluetoothMac)).append("\n"); - sb.append(" companyAccount: ").append(toIndentedString(companyAccount)).append("\n"); - sb.append(" country: ").append(toIndentedString(country)).append("\n"); - sb.append(" deviceModel: ").append(toIndentedString(deviceModel)).append("\n"); - sb.append(" dhcpEnabled: ").append(toIndentedString(dhcpEnabled)).append("\n"); - sb.append(" displayLabel: ").append(toIndentedString(displayLabel)).append("\n"); - sb.append(" ethernetIp: ").append(toIndentedString(ethernetIp)).append("\n"); - sb.append(" ethernetMac: ").append(toIndentedString(ethernetMac)).append("\n"); - sb.append(" firmwareVersion: ").append(toIndentedString(firmwareVersion)).append("\n"); - sb.append(" iccid: ").append(toIndentedString(iccid)).append("\n"); - sb.append(" lastActivityDateTime: ").append(toIndentedString(lastActivityDateTime)).append("\n"); - sb.append(" lastTransactionDateTime: ").append(toIndentedString(lastTransactionDateTime)).append("\n"); - sb.append(" linkNegotiation: ").append(toIndentedString(linkNegotiation)).append("\n"); - sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); - sb.append(" merchantInventory: ").append(toIndentedString(merchantInventory)).append("\n"); - sb.append(" permanentTerminalId: ").append(toIndentedString(permanentTerminalId)).append("\n"); - sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); - sb.append(" simStatus: ").append(toIndentedString(simStatus)).append("\n"); - sb.append(" store: ").append(toIndentedString(store)).append("\n"); - sb.append(" storeDetails: ").append(toIndentedString(storeDetails)).append("\n"); - sb.append(" terminal: ").append(toIndentedString(terminal)).append("\n"); - sb.append(" terminalStatus: ").append(toIndentedString(terminalStatus)).append("\n"); - sb.append(" wifiIp: ").append(toIndentedString(wifiIp)).append("\n"); - sb.append(" wifiMac: ").append(toIndentedString(wifiMac)).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"; + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + + public GetTerminalDetailsResponse simStatus(String simStatus) { + + this.simStatus = simStatus; + return this; + } + + /** + * On a terminal that supports 3G or 4G connectivity, indicates the status of the SIM card in the terminal: ACTIVE or INVENTORY. + * @return simStatus + **/ + @ApiModelProperty(value = "On a terminal that supports 3G or 4G connectivity, indicates the status of the SIM card in the terminal: ACTIVE or INVENTORY.") + + public String getSimStatus() { + return simStatus; + } + + + public void setSimStatus(String simStatus) { + this.simStatus = simStatus; + } + + + public GetTerminalDetailsResponse store(String store) { + + this.store = store; + return this; + } + + /** + * The store code of the store that the terminal is assigned to. + * @return store + **/ + @ApiModelProperty(value = "The store code of the store that the terminal is assigned to.") + + public String getStore() { + return store; + } + + + public void setStore(String store) { + this.store = store; + } + + + public GetTerminalDetailsResponse storeDetails(Store storeDetails) { + + this.storeDetails = storeDetails; + return this; + } + + /** + * Get storeDetails + * @return storeDetails + **/ + @ApiModelProperty(value = "") + + public Store getStoreDetails() { + return storeDetails; + } + + + public void setStoreDetails(Store storeDetails) { + this.storeDetails = storeDetails; + } + + + public GetTerminalDetailsResponse terminal(String terminal) { + + this.terminal = terminal; + return this; + } + + /** + * The unique terminal ID. + * @return terminal + **/ + @ApiModelProperty(required = true, value = "The unique terminal ID.") + + public String getTerminal() { + return terminal; + } + + + public void setTerminal(String terminal) { + this.terminal = terminal; + } + + + public GetTerminalDetailsResponse terminalStatus(TerminalStatusEnum terminalStatus) { + + this.terminalStatus = terminalStatus; + return this; + } + + /** + * The status of the terminal: - `OnlineToday`, `OnlineLast1Day`, `OnlineLast2Days` etcetera to `OnlineLast7Days`: Indicates when in the past week the terminal was last online. - `SwitchedOff`: Indicates it was more than a week ago that the terminal was last online. - `ReAssignToInventoryPending`, `ReAssignToStorePending`, `ReAssignToMerchantInventoryPending`: Indicates the terminal is scheduled to be reassigned. + * @return terminalStatus + **/ + @ApiModelProperty(value = "The status of the terminal: - `OnlineToday`, `OnlineLast1Day`, `OnlineLast2Days` etcetera to `OnlineLast7Days`: Indicates when in the past week the terminal was last online. - `SwitchedOff`: Indicates it was more than a week ago that the terminal was last online. - `ReAssignToInventoryPending`, `ReAssignToStorePending`, `ReAssignToMerchantInventoryPending`: Indicates the terminal is scheduled to be reassigned.") + + public TerminalStatusEnum getTerminalStatus() { + return terminalStatus; + } + + + public void setTerminalStatus(TerminalStatusEnum terminalStatus) { + this.terminalStatus = terminalStatus; + } + + + public GetTerminalDetailsResponse wifiIp(String wifiIp) { + + this.wifiIp = wifiIp; + return this; + } + + /** + * The terminal's IP address in your Wi-Fi network. + * @return wifiIp + **/ + @ApiModelProperty(value = "The terminal's IP address in your Wi-Fi network.") + + public String getWifiIp() { + return wifiIp; + } + + + public void setWifiIp(String wifiIp) { + this.wifiIp = wifiIp; + } + + + public GetTerminalDetailsResponse wifiMac(String wifiMac) { + + this.wifiMac = wifiMac; + return this; + } + + /** + * The terminal's MAC address in your Wi-Fi network. + * @return wifiMac + **/ + @ApiModelProperty(value = "The terminal's MAC address in your Wi-Fi network.") + + public String getWifiMac() { + return wifiMac; + } + + + public void setWifiMac(String wifiMac) { + this.wifiMac = wifiMac; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTerminalDetailsResponse getTerminalDetailsResponse = (GetTerminalDetailsResponse) o; + return Objects.equals(this.bluetoothIp, getTerminalDetailsResponse.bluetoothIp) && + Objects.equals(this.bluetoothMac, getTerminalDetailsResponse.bluetoothMac) && + Objects.equals(this.companyAccount, getTerminalDetailsResponse.companyAccount) && + Objects.equals(this.country, getTerminalDetailsResponse.country) && + Objects.equals(this.deviceModel, getTerminalDetailsResponse.deviceModel) && + Objects.equals(this.dhcpEnabled, getTerminalDetailsResponse.dhcpEnabled) && + Objects.equals(this.displayLabel, getTerminalDetailsResponse.displayLabel) && + Objects.equals(this.ethernetIp, getTerminalDetailsResponse.ethernetIp) && + Objects.equals(this.ethernetMac, getTerminalDetailsResponse.ethernetMac) && + Objects.equals(this.firmwareVersion, getTerminalDetailsResponse.firmwareVersion) && + Objects.equals(this.iccid, getTerminalDetailsResponse.iccid) && + Objects.equals(this.lastActivityDateTime, getTerminalDetailsResponse.lastActivityDateTime) && + Objects.equals(this.lastTransactionDateTime, getTerminalDetailsResponse.lastTransactionDateTime) && + Objects.equals(this.linkNegotiation, getTerminalDetailsResponse.linkNegotiation) && + Objects.equals(this.merchantAccount, getTerminalDetailsResponse.merchantAccount) && + Objects.equals(this.merchantInventory, getTerminalDetailsResponse.merchantInventory) && + Objects.equals(this.permanentTerminalId, getTerminalDetailsResponse.permanentTerminalId) && + Objects.equals(this.serialNumber, getTerminalDetailsResponse.serialNumber) && + Objects.equals(this.simStatus, getTerminalDetailsResponse.simStatus) && + Objects.equals(this.store, getTerminalDetailsResponse.store) && + Objects.equals(this.storeDetails, getTerminalDetailsResponse.storeDetails) && + Objects.equals(this.terminal, getTerminalDetailsResponse.terminal) && + Objects.equals(this.terminalStatus, getTerminalDetailsResponse.terminalStatus) && + Objects.equals(this.wifiIp, getTerminalDetailsResponse.wifiIp) && + Objects.equals(this.wifiMac, getTerminalDetailsResponse.wifiMac); + } + + @Override + public int hashCode() { + return Objects.hash(bluetoothIp, bluetoothMac, companyAccount, country, deviceModel, dhcpEnabled, displayLabel, ethernetIp, ethernetMac, firmwareVersion, iccid, lastActivityDateTime, lastTransactionDateTime, linkNegotiation, merchantAccount, merchantInventory, permanentTerminalId, serialNumber, simStatus, store, storeDetails, terminal, terminalStatus, wifiIp, wifiMac); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTerminalDetailsResponse {\n"); + sb.append(" bluetoothIp: ").append(toIndentedString(bluetoothIp)).append("\n"); + sb.append(" bluetoothMac: ").append(toIndentedString(bluetoothMac)).append("\n"); + sb.append(" companyAccount: ").append(toIndentedString(companyAccount)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" deviceModel: ").append(toIndentedString(deviceModel)).append("\n"); + sb.append(" dhcpEnabled: ").append(toIndentedString(dhcpEnabled)).append("\n"); + sb.append(" displayLabel: ").append(toIndentedString(displayLabel)).append("\n"); + sb.append(" ethernetIp: ").append(toIndentedString(ethernetIp)).append("\n"); + sb.append(" ethernetMac: ").append(toIndentedString(ethernetMac)).append("\n"); + sb.append(" firmwareVersion: ").append(toIndentedString(firmwareVersion)).append("\n"); + sb.append(" iccid: ").append(toIndentedString(iccid)).append("\n"); + sb.append(" lastActivityDateTime: ").append(toIndentedString(lastActivityDateTime)).append("\n"); + sb.append(" lastTransactionDateTime: ").append(toIndentedString(lastTransactionDateTime)).append("\n"); + sb.append(" linkNegotiation: ").append(toIndentedString(linkNegotiation)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" merchantInventory: ").append(toIndentedString(merchantInventory)).append("\n"); + sb.append(" permanentTerminalId: ").append(toIndentedString(permanentTerminalId)).append("\n"); + sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); + sb.append(" simStatus: ").append(toIndentedString(simStatus)).append("\n"); + sb.append(" store: ").append(toIndentedString(store)).append("\n"); + sb.append(" storeDetails: ").append(toIndentedString(storeDetails)).append("\n"); + sb.append(" terminal: ").append(toIndentedString(terminal)).append("\n"); + sb.append(" terminalStatus: ").append(toIndentedString(terminalStatus)).append("\n"); + sb.append(" wifiIp: ").append(toIndentedString(wifiIp)).append("\n"); + sb.append(" wifiMac: ").append(toIndentedString(wifiMac)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("bluetoothIp"); + openapiFields.add("bluetoothMac"); + openapiFields.add("companyAccount"); + openapiFields.add("country"); + openapiFields.add("deviceModel"); + openapiFields.add("dhcpEnabled"); + openapiFields.add("displayLabel"); + openapiFields.add("ethernetIp"); + openapiFields.add("ethernetMac"); + openapiFields.add("firmwareVersion"); + openapiFields.add("iccid"); + openapiFields.add("lastActivityDateTime"); + openapiFields.add("lastTransactionDateTime"); + openapiFields.add("linkNegotiation"); + openapiFields.add("merchantAccount"); + openapiFields.add("merchantInventory"); + openapiFields.add("permanentTerminalId"); + openapiFields.add("serialNumber"); + openapiFields.add("simStatus"); + openapiFields.add("store"); + openapiFields.add("storeDetails"); + openapiFields.add("terminal"); + openapiFields.add("terminalStatus"); + openapiFields.add("wifiIp"); + openapiFields.add("wifiMac"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("companyAccount"); + openapiRequiredFields.add("terminal"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTerminalDetailsResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GetTerminalDetailsResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GetTerminalDetailsResponse is not found in the empty JSON string", GetTerminalDetailsResponse.openapiRequiredFields.toString())); } - return o.toString().replace("\n", "\n "); - } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTerminalDetailsResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTerminalDetailsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTerminalDetailsResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field bluetoothIp + if (jsonObj.get("bluetoothIp") != null && !jsonObj.get("bluetoothIp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bluetoothIp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bluetoothIp").toString())); + } + // validate the optional field bluetoothMac + if (jsonObj.get("bluetoothMac") != null && !jsonObj.get("bluetoothMac").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `bluetoothMac` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bluetoothMac").toString())); + } + // validate the optional field companyAccount + if (jsonObj.get("companyAccount") != null && !jsonObj.get("companyAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `companyAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyAccount").toString())); + } + // validate the optional field country + if (jsonObj.get("country") != null && !jsonObj.get("country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("country").toString())); + } + // validate the optional field deviceModel + if (jsonObj.get("deviceModel") != null && !jsonObj.get("deviceModel").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deviceModel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceModel").toString())); + } + // validate the optional field displayLabel + if (jsonObj.get("displayLabel") != null && !jsonObj.get("displayLabel").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `displayLabel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayLabel").toString())); + } + // validate the optional field ethernetIp + if (jsonObj.get("ethernetIp") != null && !jsonObj.get("ethernetIp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethernetIp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethernetIp").toString())); + } + // validate the optional field ethernetMac + if (jsonObj.get("ethernetMac") != null && !jsonObj.get("ethernetMac").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ethernetMac` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ethernetMac").toString())); + } + // validate the optional field firmwareVersion + if (jsonObj.get("firmwareVersion") != null && !jsonObj.get("firmwareVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `firmwareVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firmwareVersion").toString())); + } + // validate the optional field iccid + if (jsonObj.get("iccid") != null && !jsonObj.get("iccid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `iccid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iccid").toString())); + } + // validate the optional field linkNegotiation + if (jsonObj.get("linkNegotiation") != null && !jsonObj.get("linkNegotiation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `linkNegotiation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("linkNegotiation").toString())); + } + // validate the optional field merchantAccount + if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); + } + // validate the optional field permanentTerminalId + if (jsonObj.get("permanentTerminalId") != null && !jsonObj.get("permanentTerminalId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `permanentTerminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("permanentTerminalId").toString())); + } + // validate the optional field serialNumber + if (jsonObj.get("serialNumber") != null && !jsonObj.get("serialNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `serialNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("serialNumber").toString())); + } + // validate the optional field simStatus + if (jsonObj.get("simStatus") != null && !jsonObj.get("simStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `simStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("simStatus").toString())); + } + // validate the optional field store + if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); + } + // validate the optional field `storeDetails` + if (jsonObj.getAsJsonObject("storeDetails") != null) { + Store.validateJsonObject(jsonObj.getAsJsonObject("storeDetails")); + } + // validate the optional field terminal + if (jsonObj.get("terminal") != null && !jsonObj.get("terminal").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `terminal` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminal").toString())); + } + // ensure the field terminalStatus can be parsed to an enum value + if (jsonObj.get("terminalStatus") != null) { + if(!jsonObj.get("terminalStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `terminalStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminalStatus").toString())); + } + TerminalStatusEnum.fromValue(jsonObj.get("terminalStatus").getAsString()); + } + // validate the optional field wifiIp + if (jsonObj.get("wifiIp") != null && !jsonObj.get("wifiIp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `wifiIp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("wifiIp").toString())); + } + // validate the optional field wifiMac + if (jsonObj.get("wifiMac") != null && !jsonObj.get("wifiMac").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `wifiMac` to be a primitive type in the JSON string but got `%s`", jsonObj.get("wifiMac").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTerminalDetailsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTerminalDetailsResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetTerminalDetailsResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTerminalDetailsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetTerminalDetailsResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetTerminalDetailsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTerminalDetailsResponse + * @throws IOException if the JSON string is invalid with respect to GetTerminalDetailsResponse + */ + public static GetTerminalDetailsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTerminalDetailsResponse.class); + } + + /** + * Convert an instance of GetTerminalDetailsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountRequest.java b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountRequest.java old mode 100755 new mode 100644 index 545e8bbb1..a2b6625d6 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountRequest.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountRequest.java @@ -1,140 +1,283 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. * - * Adyen Java API Library + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.posterminalmanagement; import java.util.Objects; - +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.posterminalmanagement.JSON; /** * GetTerminalsUnderAccountRequest */ public class GetTerminalsUnderAccountRequest { - @SerializedName("companyAccount") - private String companyAccount = null; + public static final String SERIALIZED_NAME_COMPANY_ACCOUNT = "companyAccount"; + @SerializedName(SERIALIZED_NAME_COMPANY_ACCOUNT) + private String companyAccount; - @SerializedName("merchantAccount") - private String merchantAccount = null; + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT = "merchantAccount"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) + private String merchantAccount; - @SerializedName("store") - private String store = null; + public static final String SERIALIZED_NAME_STORE = "store"; + @SerializedName(SERIALIZED_NAME_STORE) + private String store; - public GetTerminalsUnderAccountRequest companyAccount(String companyAccount) { - this.companyAccount = companyAccount; - return this; - } + public GetTerminalsUnderAccountRequest() { + } - /** - * Your company account. If you only specify this parameter, the response includes all terminals at all account levels. - * - * @return companyAccount - **/ - public String getCompanyAccount() { - return companyAccount; - } + public GetTerminalsUnderAccountRequest companyAccount(String companyAccount) { + + this.companyAccount = companyAccount; + return this; + } - public void setCompanyAccount(String companyAccount) { - this.companyAccount = companyAccount; - } + /** + * Your company account. If you only specify this parameter, the response includes all terminals at all account levels. + * @return companyAccount + **/ + @ApiModelProperty(required = true, value = "Your company account. If you only specify this parameter, the response includes all terminals at all account levels.") - public GetTerminalsUnderAccountRequest merchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - return this; - } + public String getCompanyAccount() { + return companyAccount; + } - /** - * The merchant account. This is required if you are retrieving the terminals assigned to a store.If you don't specify a `store` the response includes the terminals assigned to the specified merchant account and the terminals assigned to the stores under this merchant account. - * - * @return merchantAccount - **/ - public String getMerchantAccount() { - return merchantAccount; - } - public void setMerchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - } + public void setCompanyAccount(String companyAccount) { + this.companyAccount = companyAccount; + } - public GetTerminalsUnderAccountRequest store(String store) { - this.store = store; - return this; - } - /** - * The store code of the store. With this parameter, the response only includes the terminals assigned to the specified store. - * - * @return store - **/ - public String getStore() { - return store; + public GetTerminalsUnderAccountRequest merchantAccount(String merchantAccount) { + + this.merchantAccount = merchantAccount; + return this; + } + + /** + * The merchant account. This is required if you are retrieving the terminals assigned to a store.If you don't specify a `store` the response includes the terminals assigned to the specified merchant account and the terminals assigned to the stores under this merchant account. + * @return merchantAccount + **/ + @ApiModelProperty(value = "The merchant account. This is required if you are retrieving the terminals assigned to a store.If you don't specify a `store` the response includes the terminals assigned to the specified merchant account and the terminals assigned to the stores under this merchant account.") + + public String getMerchantAccount() { + return merchantAccount; + } + + + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } + + + public GetTerminalsUnderAccountRequest store(String store) { + + this.store = store; + return this; + } + + /** + * The store code of the store. With this parameter, the response only includes the terminals assigned to the specified store. + * @return store + **/ + @ApiModelProperty(value = "The store code of the store. With this parameter, the response only includes the terminals assigned to the specified store.") + + public String getStore() { + return store; + } + + + public void setStore(String store) { + this.store = store; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } + GetTerminalsUnderAccountRequest getTerminalsUnderAccountRequest = (GetTerminalsUnderAccountRequest) o; + return Objects.equals(this.companyAccount, getTerminalsUnderAccountRequest.companyAccount) && + Objects.equals(this.merchantAccount, getTerminalsUnderAccountRequest.merchantAccount) && + Objects.equals(this.store, getTerminalsUnderAccountRequest.store); + } + + @Override + public int hashCode() { + return Objects.hash(companyAccount, merchantAccount, store); + } - public void setStore(String store) { - this.store = store; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTerminalsUnderAccountRequest {\n"); + sb.append(" companyAccount: ").append(toIndentedString(companyAccount)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" store: ").append(toIndentedString(store)).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 "); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("companyAccount"); + openapiFields.add("merchantAccount"); + openapiFields.add("store"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("companyAccount"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTerminalsUnderAccountRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GetTerminalsUnderAccountRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GetTerminalsUnderAccountRequest is not found in the empty JSON string", GetTerminalsUnderAccountRequest.openapiRequiredFields.toString())); } - if (o == null || getClass() != o.getClass()) { - return false; + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTerminalsUnderAccountRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTerminalsUnderAccountRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - GetTerminalsUnderAccountRequest getTerminalsUnderAccountRequest = (GetTerminalsUnderAccountRequest) o; - return Objects.equals(this.companyAccount, getTerminalsUnderAccountRequest.companyAccount) && - Objects.equals(this.merchantAccount, getTerminalsUnderAccountRequest.merchantAccount) && - Objects.equals(this.store, getTerminalsUnderAccountRequest.store); - } + } + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTerminalsUnderAccountRequest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field companyAccount + if (jsonObj.get("companyAccount") != null && !jsonObj.get("companyAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `companyAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyAccount").toString())); + } + // validate the optional field merchantAccount + if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); + } + // validate the optional field store + if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") @Override - public int hashCode() { - return Objects.hash(companyAccount, merchantAccount, store); - } + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTerminalsUnderAccountRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTerminalsUnderAccountRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetTerminalsUnderAccountRequest.class)); + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTerminalsUnderAccountRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTerminalsUnderAccountRequest {\n"); - - sb.append(" companyAccount: ").append(toIndentedString(companyAccount)).append("\n"); - sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); - sb.append(" store: ").append(toIndentedString(store)).append("\n"); - sb.append("}"); - return sb.toString(); - } + @Override + public GetTerminalsUnderAccountRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } - /** - * 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 "); + }.nullSafe(); } + } + /** + * Create an instance of GetTerminalsUnderAccountRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTerminalsUnderAccountRequest + * @throws IOException if the JSON string is invalid with respect to GetTerminalsUnderAccountRequest + */ + public static GetTerminalsUnderAccountRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTerminalsUnderAccountRequest.class); + } + + /** + * Convert an instance of GetTerminalsUnderAccountRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountResponse.java b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountResponse.java old mode 100755 new mode 100644 index e677b5efe..014f95ec1 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountResponse.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountResponse.java @@ -1,159 +1,310 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. * - * Adyen Java API Library + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.posterminalmanagement; import java.util.Objects; - +import java.util.Arrays; +import com.adyen.model.posterminalmanagement.MerchantAccount; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; - +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.posterminalmanagement.JSON; + /** * GetTerminalsUnderAccountResponse */ public class GetTerminalsUnderAccountResponse { - @SerializedName("companyAccount") - private String companyAccount = null; + public static final String SERIALIZED_NAME_COMPANY_ACCOUNT = "companyAccount"; + @SerializedName(SERIALIZED_NAME_COMPANY_ACCOUNT) + private String companyAccount; - @SerializedName("inventoryTerminals") - private List inventoryTerminals = null; + public static final String SERIALIZED_NAME_INVENTORY_TERMINALS = "inventoryTerminals"; + @SerializedName(SERIALIZED_NAME_INVENTORY_TERMINALS) + private List inventoryTerminals = null; - @SerializedName("merchantAccounts") - private List merchantAccounts = null; + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNTS = "merchantAccounts"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNTS) + private List merchantAccounts = null; - public GetTerminalsUnderAccountResponse companyAccount(String companyAccount) { - this.companyAccount = companyAccount; - return this; - } + public GetTerminalsUnderAccountResponse() { + } - /** - * Your company account. - * - * @return companyAccount - **/ - public String getCompanyAccount() { - return companyAccount; - } + public GetTerminalsUnderAccountResponse companyAccount(String companyAccount) { + + this.companyAccount = companyAccount; + return this; + } - public void setCompanyAccount(String companyAccount) { - this.companyAccount = companyAccount; - } + /** + * Your company account. + * @return companyAccount + **/ + @ApiModelProperty(required = true, value = "Your company account.") - public GetTerminalsUnderAccountResponse inventoryTerminals(List inventoryTerminals) { - this.inventoryTerminals = inventoryTerminals; - return this; - } + public String getCompanyAccount() { + return companyAccount; + } - public GetTerminalsUnderAccountResponse addInventoryTerminalsItem(String inventoryTerminalsItem) { - if (this.inventoryTerminals == null) { - this.inventoryTerminals = new ArrayList(); - } - this.inventoryTerminals.add(inventoryTerminalsItem); - return this; - } - /** - * Array that returns a list of all terminals that are in the inventory of the company account. - * - * @return inventoryTerminals - **/ - public List getInventoryTerminals() { - return inventoryTerminals; - } + public void setCompanyAccount(String companyAccount) { + this.companyAccount = companyAccount; + } - public void setInventoryTerminals(List inventoryTerminals) { - this.inventoryTerminals = inventoryTerminals; - } - public GetTerminalsUnderAccountResponse merchantAccounts(List merchantAccounts) { - this.merchantAccounts = merchantAccounts; - return this; + public GetTerminalsUnderAccountResponse inventoryTerminals(List inventoryTerminals) { + + this.inventoryTerminals = inventoryTerminals; + return this; + } + + public GetTerminalsUnderAccountResponse addInventoryTerminalsItem(String inventoryTerminalsItem) { + if (this.inventoryTerminals == null) { + this.inventoryTerminals = new ArrayList<>(); } + this.inventoryTerminals.add(inventoryTerminalsItem); + return this; + } - public GetTerminalsUnderAccountResponse addMerchantAccountsItem(MerchantAccount merchantAccountsItem) { - if (this.merchantAccounts == null) { - this.merchantAccounts = new ArrayList(); - } - this.merchantAccounts.add(merchantAccountsItem); - return this; + /** + * Array that returns a list of all terminals that are in the inventory of the company account. + * @return inventoryTerminals + **/ + @ApiModelProperty(value = "Array that returns a list of all terminals that are in the inventory of the company account.") + + public List getInventoryTerminals() { + return inventoryTerminals; + } + + + public void setInventoryTerminals(List inventoryTerminals) { + this.inventoryTerminals = inventoryTerminals; + } + + + public GetTerminalsUnderAccountResponse merchantAccounts(List merchantAccounts) { + + this.merchantAccounts = merchantAccounts; + return this; + } + + public GetTerminalsUnderAccountResponse addMerchantAccountsItem(MerchantAccount merchantAccountsItem) { + if (this.merchantAccounts == null) { + this.merchantAccounts = new ArrayList<>(); } + this.merchantAccounts.add(merchantAccountsItem); + return this; + } + + /** + * Array that returns a list of all merchant accounts belonging to the company account. + * @return merchantAccounts + **/ + @ApiModelProperty(value = "Array that returns a list of all merchant accounts belonging to the company account.") + + public List getMerchantAccounts() { + return merchantAccounts; + } - /** - * Array that returns a list of all merchant accounts belonging to the company account. - * - * @return merchantAccounts - **/ - public List getMerchantAccounts() { - return merchantAccounts; + + public void setMerchantAccounts(List merchantAccounts) { + this.merchantAccounts = merchantAccounts; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } + GetTerminalsUnderAccountResponse getTerminalsUnderAccountResponse = (GetTerminalsUnderAccountResponse) o; + return Objects.equals(this.companyAccount, getTerminalsUnderAccountResponse.companyAccount) && + Objects.equals(this.inventoryTerminals, getTerminalsUnderAccountResponse.inventoryTerminals) && + Objects.equals(this.merchantAccounts, getTerminalsUnderAccountResponse.merchantAccounts); + } + + @Override + public int hashCode() { + return Objects.hash(companyAccount, inventoryTerminals, merchantAccounts); + } - public void setMerchantAccounts(List merchantAccounts) { - this.merchantAccounts = merchantAccounts; + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetTerminalsUnderAccountResponse {\n"); + sb.append(" companyAccount: ").append(toIndentedString(companyAccount)).append("\n"); + sb.append(" inventoryTerminals: ").append(toIndentedString(inventoryTerminals)).append("\n"); + sb.append(" merchantAccounts: ").append(toIndentedString(merchantAccounts)).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 "); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("companyAccount"); + openapiFields.add("inventoryTerminals"); + openapiFields.add("merchantAccounts"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("companyAccount"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GetTerminalsUnderAccountResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GetTerminalsUnderAccountResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GetTerminalsUnderAccountResponse is not found in the empty JSON string", GetTerminalsUnderAccountResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!GetTerminalsUnderAccountResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTerminalsUnderAccountResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - if (o == null || getClass() != o.getClass()) { - return false; + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GetTerminalsUnderAccountResponse.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); } - GetTerminalsUnderAccountResponse getTerminalsUnderAccountResponse = (GetTerminalsUnderAccountResponse) o; - return Objects.equals(this.companyAccount, getTerminalsUnderAccountResponse.companyAccount) && - Objects.equals(this.inventoryTerminals, getTerminalsUnderAccountResponse.inventoryTerminals) && - Objects.equals(this.merchantAccounts, getTerminalsUnderAccountResponse.merchantAccounts); - } + } + // validate the optional field companyAccount + if (jsonObj.get("companyAccount") != null && !jsonObj.get("companyAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `companyAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyAccount").toString())); + } + // ensure the json data is an array + if (jsonObj.get("inventoryTerminals") != null && !jsonObj.get("inventoryTerminals").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `inventoryTerminals` to be an array in the JSON string but got `%s`", jsonObj.get("inventoryTerminals").toString())); + } + JsonArray jsonArraymerchantAccounts = jsonObj.getAsJsonArray("merchantAccounts"); + if (jsonArraymerchantAccounts != null) { + // ensure the json data is an array + if (!jsonObj.get("merchantAccounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `merchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("merchantAccounts").toString())); + } + + // validate the optional field `merchantAccounts` (array) + for (int i = 0; i < jsonArraymerchantAccounts.size(); i++) { + MerchantAccount.validateJsonObject(jsonArraymerchantAccounts.get(i).getAsJsonObject()); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") @Override - public int hashCode() { - return Objects.hash(companyAccount, inventoryTerminals, merchantAccounts); - } + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetTerminalsUnderAccountResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetTerminalsUnderAccountResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetTerminalsUnderAccountResponse.class)); + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, GetTerminalsUnderAccountResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GetTerminalsUnderAccountResponse {\n"); - - sb.append(" companyAccount: ").append(toIndentedString(companyAccount)).append("\n"); - sb.append(" inventoryTerminals: ").append(toIndentedString(inventoryTerminals)).append("\n"); - sb.append(" merchantAccounts: ").append(toIndentedString(merchantAccounts)).append("\n"); - sb.append("}"); - return sb.toString(); - } + @Override + public GetTerminalsUnderAccountResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } - /** - * 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 "); + }.nullSafe(); } + } + + /** + * Create an instance of GetTerminalsUnderAccountResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetTerminalsUnderAccountResponse + * @throws IOException if the JSON string is invalid with respect to GetTerminalsUnderAccountResponse + */ + public static GetTerminalsUnderAccountResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetTerminalsUnderAccountResponse.class); + } + /** + * Convert an instance of GetTerminalsUnderAccountResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/posterminalmanagement/JSON.java b/src/main/java/com/adyen/model/posterminalmanagement/JSON.java new file mode 100644 index 000000000..25e33d65b --- /dev/null +++ b/src/main/java/com/adyen/model/posterminalmanagement/JSON.java @@ -0,0 +1,413 @@ +/* + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.posterminalmanagement; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import org.apache.commons.codec.binary.Base64; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.posterminalmanagement.Address.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.posterminalmanagement.AssignTerminalsRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.posterminalmanagement.AssignTerminalsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.posterminalmanagement.FindTerminalRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.posterminalmanagement.FindTerminalResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.posterminalmanagement.GetStoresUnderAccountRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.posterminalmanagement.GetStoresUnderAccountResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.posterminalmanagement.GetTerminalDetailsRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.posterminalmanagement.GetTerminalDetailsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.posterminalmanagement.GetTerminalsUnderAccountRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.posterminalmanagement.GetTerminalsUnderAccountResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.posterminalmanagement.MerchantAccount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.posterminalmanagement.ServiceError.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.posterminalmanagement.Store.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(new String(value)); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + return Base64.decodeBase64(bytesAsBase64); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/src/main/java/com/adyen/model/posterminalmanagement/MerchantAccount.java b/src/main/java/com/adyen/model/posterminalmanagement/MerchantAccount.java old mode 100755 new mode 100644 index ca90908ae..237d6d0da --- a/src/main/java/com/adyen/model/posterminalmanagement/MerchantAccount.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/MerchantAccount.java @@ -1,190 +1,351 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. * - * Adyen Java API Library + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.posterminalmanagement; import java.util.Objects; - +import java.util.Arrays; +import com.adyen.model.posterminalmanagement.Store; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; - +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.posterminalmanagement.JSON; + /** * MerchantAccount */ public class MerchantAccount { - @SerializedName("inStoreTerminals") - private List inStoreTerminals = null; + public static final String SERIALIZED_NAME_IN_STORE_TERMINALS = "inStoreTerminals"; + @SerializedName(SERIALIZED_NAME_IN_STORE_TERMINALS) + private List inStoreTerminals = null; + + public static final String SERIALIZED_NAME_INVENTORY_TERMINALS = "inventoryTerminals"; + @SerializedName(SERIALIZED_NAME_INVENTORY_TERMINALS) + private List inventoryTerminals = null; + + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT = "merchantAccount"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) + private String merchantAccount; + + public static final String SERIALIZED_NAME_STORES = "stores"; + @SerializedName(SERIALIZED_NAME_STORES) + private List stores = null; + + public MerchantAccount() { + } + + public MerchantAccount inStoreTerminals(List inStoreTerminals) { + + this.inStoreTerminals = inStoreTerminals; + return this; + } + + public MerchantAccount addInStoreTerminalsItem(String inStoreTerminalsItem) { + if (this.inStoreTerminals == null) { + this.inStoreTerminals = new ArrayList<>(); + } + this.inStoreTerminals.add(inStoreTerminalsItem); + return this; + } - @SerializedName("inventoryTerminals") - private List inventoryTerminals = null; + /** + * List of terminals assigned to this merchant account as in-store terminals. This means that the terminal is ready to be boarded, or is already boarded. + * @return inStoreTerminals + **/ + @ApiModelProperty(value = "List of terminals assigned to this merchant account as in-store terminals. This means that the terminal is ready to be boarded, or is already boarded.") - @SerializedName("merchantAccount") - private String merchantAccount = null; + public List getInStoreTerminals() { + return inStoreTerminals; + } - @SerializedName("stores") - private List stores = null; - public MerchantAccount inStoreTerminals(List inStoreTerminals) { - this.inStoreTerminals = inStoreTerminals; - return this; - } + public void setInStoreTerminals(List inStoreTerminals) { + this.inStoreTerminals = inStoreTerminals; + } - public MerchantAccount addInStoreTerminalsItem(String inStoreTerminalsItem) { - if (this.inStoreTerminals == null) { - this.inStoreTerminals = new ArrayList(); - } - this.inStoreTerminals.add(inStoreTerminalsItem); - return this; - } - /** - * List of terminals assigned to this merchant account as in-store terminals. This means that the terminal is ready to be boarded, or is already boarded. - * - * @return inStoreTerminals - **/ - public List getInStoreTerminals() { - return inStoreTerminals; - } + public MerchantAccount inventoryTerminals(List inventoryTerminals) { + + this.inventoryTerminals = inventoryTerminals; + return this; + } - public void setInStoreTerminals(List inStoreTerminals) { - this.inStoreTerminals = inStoreTerminals; + public MerchantAccount addInventoryTerminalsItem(String inventoryTerminalsItem) { + if (this.inventoryTerminals == null) { + this.inventoryTerminals = new ArrayList<>(); } + this.inventoryTerminals.add(inventoryTerminalsItem); + return this; + } - public MerchantAccount inventoryTerminals(List inventoryTerminals) { - this.inventoryTerminals = inventoryTerminals; - return this; - } + /** + * List of terminals assigned to the inventory of this merchant account. + * @return inventoryTerminals + **/ + @ApiModelProperty(value = "List of terminals assigned to the inventory of this merchant account.") - public MerchantAccount addInventoryTerminalsItem(String inventoryTerminalsItem) { - if (this.inventoryTerminals == null) { - this.inventoryTerminals = new ArrayList(); - } - this.inventoryTerminals.add(inventoryTerminalsItem); - return this; - } + public List getInventoryTerminals() { + return inventoryTerminals; + } - /** - * List of terminals assigned to the inventory of this merchant account. - * - * @return inventoryTerminals - **/ - public List getInventoryTerminals() { - return inventoryTerminals; - } - public void setInventoryTerminals(List inventoryTerminals) { - this.inventoryTerminals = inventoryTerminals; - } + public void setInventoryTerminals(List inventoryTerminals) { + this.inventoryTerminals = inventoryTerminals; + } - public MerchantAccount merchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - return this; - } - /** - * The merchant account. - * - * @return merchantAccount - **/ - public String getMerchantAccount() { - return merchantAccount; - } + public MerchantAccount merchantAccount(String merchantAccount) { + + this.merchantAccount = merchantAccount; + return this; + } - public void setMerchantAccount(String merchantAccount) { - this.merchantAccount = merchantAccount; - } + /** + * The merchant account. + * @return merchantAccount + **/ + @ApiModelProperty(required = true, value = "The merchant account.") - public MerchantAccount stores(List stores) { - this.stores = stores; - return this; - } + public String getMerchantAccount() { + return merchantAccount; + } - public MerchantAccount addStoresItem(Store storesItem) { - if (this.stores == null) { - this.stores = new ArrayList(); - } - this.stores.add(storesItem); - return this; - } - /** - * Array of stores under this merchant account. - * - * @return stores - **/ - public List getStores() { - return stores; - } + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } - public void setStores(List stores) { - this.stores = stores; - } + public MerchantAccount stores(List stores) { + + this.stores = stores; + return this; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MerchantAccount merchantAccount = (MerchantAccount) o; - return Objects.equals(this.inStoreTerminals, merchantAccount.inStoreTerminals) && - Objects.equals(this.inventoryTerminals, merchantAccount.inventoryTerminals) && - Objects.equals(this.merchantAccount, merchantAccount.merchantAccount) && - Objects.equals(this.stores, merchantAccount.stores); + public MerchantAccount addStoresItem(Store storesItem) { + if (this.stores == null) { + this.stores = new ArrayList<>(); } + this.stores.add(storesItem); + return this; + } - @Override - public int hashCode() { - return Objects.hash(inStoreTerminals, inventoryTerminals, merchantAccount, stores); - } + /** + * Array of stores under this merchant account. + * @return stores + **/ + @ApiModelProperty(value = "Array of stores under this merchant account.") + public List getStores() { + return stores; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MerchantAccount {\n"); - - sb.append(" inStoreTerminals: ").append(toIndentedString(inStoreTerminals)).append("\n"); - sb.append(" inventoryTerminals: ").append(toIndentedString(inventoryTerminals)).append("\n"); - sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); - sb.append(" stores: ").append(toIndentedString(stores)).append("\n"); - sb.append("}"); - return sb.toString(); + + public void setStores(List stores) { + this.stores = stores; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } + MerchantAccount merchantAccount = (MerchantAccount) o; + return Objects.equals(this.inStoreTerminals, merchantAccount.inStoreTerminals) && + Objects.equals(this.inventoryTerminals, merchantAccount.inventoryTerminals) && + Objects.equals(this.merchantAccount, merchantAccount.merchantAccount) && + Objects.equals(this.stores, merchantAccount.stores); + } + + @Override + public int hashCode() { + return Objects.hash(inStoreTerminals, inventoryTerminals, merchantAccount, stores); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MerchantAccount {\n"); + sb.append(" inStoreTerminals: ").append(toIndentedString(inStoreTerminals)).append("\n"); + sb.append(" inventoryTerminals: ").append(toIndentedString(inventoryTerminals)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" stores: ").append(toIndentedString(stores)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("inStoreTerminals"); + openapiFields.add("inventoryTerminals"); + openapiFields.add("merchantAccount"); + openapiFields.add("stores"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("merchantAccount"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MerchantAccount + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MerchantAccount.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MerchantAccount is not found in the empty JSON string", MerchantAccount.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MerchantAccount.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MerchantAccount` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MerchantAccount.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("inStoreTerminals") != null && !jsonObj.get("inStoreTerminals").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `inStoreTerminals` to be an array in the JSON string but got `%s`", jsonObj.get("inStoreTerminals").toString())); + } + // ensure the json data is an array + if (jsonObj.get("inventoryTerminals") != null && !jsonObj.get("inventoryTerminals").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `inventoryTerminals` to be an array in the JSON string but got `%s`", jsonObj.get("inventoryTerminals").toString())); + } + // validate the optional field merchantAccount + if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); + } + JsonArray jsonArraystores = jsonObj.getAsJsonArray("stores"); + if (jsonArraystores != null) { + // ensure the json data is an array + if (!jsonObj.get("stores").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `stores` to be an array in the JSON string but got `%s`", jsonObj.get("stores").toString())); } - return o.toString().replace("\n", "\n "); - } + // validate the optional field `stores` (array) + for (int i = 0; i < jsonArraystores.size(); i++) { + Store.validateJsonObject(jsonArraystores.get(i).getAsJsonObject()); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MerchantAccount.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MerchantAccount' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MerchantAccount.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MerchantAccount value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MerchantAccount read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MerchantAccount given an JSON string + * + * @param jsonString JSON string + * @return An instance of MerchantAccount + * @throws IOException if the JSON string is invalid with respect to MerchantAccount + */ + public static MerchantAccount fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MerchantAccount.class); + } + + /** + * Convert an instance of MerchantAccount to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/model/posterminalmanagement/ServiceError.java b/src/main/java/com/adyen/model/posterminalmanagement/ServiceError.java new file mode 100644 index 000000000..658607d49 --- /dev/null +++ b/src/main/java/com/adyen/model/posterminalmanagement/ServiceError.java @@ -0,0 +1,337 @@ +/* + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.posterminalmanagement; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.posterminalmanagement.JSON; + +/** + * ServiceError + */ + +public class ServiceError { + public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode"; + @SerializedName(SERIALIZED_NAME_ERROR_CODE) + private String errorCode; + + public static final String SERIALIZED_NAME_ERROR_TYPE = "errorType"; + @SerializedName(SERIALIZED_NAME_ERROR_TYPE) + private String errorType; + + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_PSP_REFERENCE = "pspReference"; + @SerializedName(SERIALIZED_NAME_PSP_REFERENCE) + private String pspReference; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Integer status; + + public ServiceError() { + } + + public ServiceError errorCode(String errorCode) { + + this.errorCode = errorCode; + return this; + } + + /** + * The error code mapped to the error message. + * @return errorCode + **/ + @ApiModelProperty(value = "The error code mapped to the error message.") + + public String getErrorCode() { + return errorCode; + } + + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + + public ServiceError errorType(String errorType) { + + this.errorType = errorType; + return this; + } + + /** + * The category of the error. + * @return errorType + **/ + @ApiModelProperty(value = "The category of the error.") + + public String getErrorType() { + return errorType; + } + + + public void setErrorType(String errorType) { + this.errorType = errorType; + } + + + public ServiceError message(String message) { + + this.message = message; + return this; + } + + /** + * A short explanation of the issue. + * @return message + **/ + @ApiModelProperty(value = "A short explanation of the issue.") + + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public ServiceError pspReference(String pspReference) { + + this.pspReference = pspReference; + return this; + } + + /** + * The PSP reference of the payment. + * @return pspReference + **/ + @ApiModelProperty(value = "The PSP reference of the payment.") + + public String getPspReference() { + return pspReference; + } + + + public void setPspReference(String pspReference) { + this.pspReference = pspReference; + } + + + public ServiceError status(Integer status) { + + this.status = status; + return this; + } + + /** + * The HTTP response status. + * @return status + **/ + @ApiModelProperty(value = "The HTTP response status.") + + public Integer getStatus() { + return status; + } + + + public void setStatus(Integer status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServiceError serviceError = (ServiceError) o; + return Objects.equals(this.errorCode, serviceError.errorCode) && + Objects.equals(this.errorType, serviceError.errorType) && + Objects.equals(this.message, serviceError.message) && + Objects.equals(this.pspReference, serviceError.pspReference) && + Objects.equals(this.status, serviceError.status); + } + + @Override + public int hashCode() { + return Objects.hash(errorCode, errorType, message, pspReference, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceError {\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" errorType: ").append(toIndentedString(errorType)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("errorCode"); + openapiFields.add("errorType"); + openapiFields.add("message"); + openapiFields.add("pspReference"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ServiceError + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ServiceError.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ServiceError is not found in the empty JSON string", ServiceError.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ServiceError.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ServiceError` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field errorCode + if (jsonObj.get("errorCode") != null && !jsonObj.get("errorCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); + } + // validate the optional field errorType + if (jsonObj.get("errorType") != null && !jsonObj.get("errorType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorType").toString())); + } + // validate the optional field message + if (jsonObj.get("message") != null && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the optional field pspReference + if (jsonObj.get("pspReference") != null && !jsonObj.get("pspReference").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ServiceError.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ServiceError' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ServiceError.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ServiceError value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ServiceError read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ServiceError given an JSON string + * + * @param jsonString JSON string + * @return An instance of ServiceError + * @throws IOException if the JSON string is invalid with respect to ServiceError + */ + public static ServiceError fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ServiceError.class); + } + + /** + * Convert an instance of ServiceError to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/posterminalmanagement/Store.java b/src/main/java/com/adyen/model/posterminalmanagement/Store.java old mode 100755 new mode 100644 index f2bd4eab9..ddd939ebd --- a/src/main/java/com/adyen/model/posterminalmanagement/Store.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/Store.java @@ -1,220 +1,393 @@ /* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. * - * Adyen Java API Library + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. + * 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.posterminalmanagement; import java.util.Objects; - +import java.util.Arrays; +import com.adyen.model.posterminalmanagement.Address; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; - +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; import java.util.ArrayList; import java.util.List; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.posterminalmanagement.JSON; + /** * Store */ public class Store { - @SerializedName("address") - private Address address = null; + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private Address address; - @SerializedName("description") - private String description = null; + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; - @SerializedName("inStoreTerminals") - private List inStoreTerminals = null; + public static final String SERIALIZED_NAME_IN_STORE_TERMINALS = "inStoreTerminals"; + @SerializedName(SERIALIZED_NAME_IN_STORE_TERMINALS) + private List inStoreTerminals = null; - @SerializedName("merchantAccountCode") - private String merchantAccountCode = null; + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT_CODE = "merchantAccountCode"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT_CODE) + private String merchantAccountCode; - @SerializedName("status") - private String status = null; + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private String status; - @SerializedName("store") - private String store = null; + public static final String SERIALIZED_NAME_STORE = "store"; + @SerializedName(SERIALIZED_NAME_STORE) + private String store; - public Store address(Address address) { - this.address = address; - return this; - } + public Store() { + } - /** - * Get address - * - * @return address - **/ - public Address getAddress() { - return address; - } + public Store address(Address address) { + + this.address = address; + return this; + } - public void setAddress(Address address) { - this.address = address; - } + /** + * Get address + * @return address + **/ + @ApiModelProperty(value = "") - public Store description(String description) { - this.description = description; - return this; - } + public Address getAddress() { + return address; + } - /** - * The store description - * - * @return description - **/ - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } + public void setAddress(Address address) { + this.address = address; + } - public Store inStoreTerminals(List inStoreTerminals) { - this.inStoreTerminals = inStoreTerminals; - return this; - } - public Store addInStoreTerminalsItem(String inStoreTerminalsItem) { - if (this.inStoreTerminals == null) { - this.inStoreTerminals = new ArrayList(); - } - this.inStoreTerminals.add(inStoreTerminalsItem); - return this; - } + public Store description(String description) { + + this.description = description; + return this; + } - /** - * List of unique terminal IDs assigned to this store - * - * @return inStoreTerminals - **/ - public List getInStoreTerminals() { - return inStoreTerminals; - } + /** + * The description of the store. + * @return description + **/ + @ApiModelProperty(value = "The description of the store.") - public void setInStoreTerminals(List inStoreTerminals) { - this.inStoreTerminals = inStoreTerminals; - } + public String getDescription() { + return description; + } - public Store merchantAccountCode(String merchantAccountCode) { - this.merchantAccountCode = merchantAccountCode; - return this; - } - /** - * Merchant account code - * - * @return merchantAccountCode - **/ - public String getMerchantAccountCode() { - return merchantAccountCode; - } + public void setDescription(String description) { + this.description = description; + } - public void setMerchantAccountCode(String merchantAccountCode) { - this.merchantAccountCode = merchantAccountCode; - } - public Store status(String status) { - this.status = status; - return this; - } + public Store inStoreTerminals(List inStoreTerminals) { + + this.inStoreTerminals = inStoreTerminals; + return this; + } - /** - * Store status. Possible values: - `PreActive`: The store has been created, but not yet activated. - `Active`: The store has been activated. This means you can process payments over the store. - `Inactive`: The store is currently not active. - `InactiveWithModifications`: The store is currently not active, but payment modifications such as refunds are still allowed. - `Closed`: The store has been closed. - * - * @return status - **/ - public String getStatus() { - return status; + public Store addInStoreTerminalsItem(String inStoreTerminalsItem) { + if (this.inStoreTerminals == null) { + this.inStoreTerminals = new ArrayList<>(); } + this.inStoreTerminals.add(inStoreTerminalsItem); + return this; + } - public void setStatus(String status) { - this.status = status; - } + /** + * The list of terminals assigned to the store. + * @return inStoreTerminals + **/ + @ApiModelProperty(value = "The list of terminals assigned to the store.") - public Store store(String store) { - this.store = store; - return this; - } + public List getInStoreTerminals() { + return inStoreTerminals; + } - /** - * The store code of the store. - * - * @return store - **/ - public String getStore() { - return store; - } - public void setStore(String store) { - this.store = store; - } + public void setInStoreTerminals(List inStoreTerminals) { + this.inStoreTerminals = inStoreTerminals; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Store store = (Store) o; - return Objects.equals(this.address, store.address) && - Objects.equals(this.description, store.description) && - Objects.equals(this.inStoreTerminals, store.inStoreTerminals) && - Objects.equals(this.merchantAccountCode, store.merchantAccountCode) && - Objects.equals(this.status, store.status) && - Objects.equals(this.store, store.store); - } + public Store merchantAccountCode(String merchantAccountCode) { + + this.merchantAccountCode = merchantAccountCode; + return this; + } - @Override - public int hashCode() { - return Objects.hash(address, description, inStoreTerminals, merchantAccountCode, status, store); - } + /** + * The code of the merchant account. + * @return merchantAccountCode + **/ + @ApiModelProperty(value = "The code of the merchant account.") + public String getMerchantAccountCode() { + return merchantAccountCode; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Store {\n"); - - sb.append(" address: ").append(toIndentedString(address)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" inStoreTerminals: ").append(toIndentedString(inStoreTerminals)).append("\n"); - sb.append(" merchantAccountCode: ").append(toIndentedString(merchantAccountCode)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" store: ").append(toIndentedString(store)).append("\n"); - sb.append("}"); - return sb.toString(); + + public void setMerchantAccountCode(String merchantAccountCode) { + this.merchantAccountCode = merchantAccountCode; + } + + + public Store status(String status) { + + this.status = status; + return this; + } + + /** + * The status of the store: - `PreActive`: the store has been created, but not yet activated. - `Active`: the store has been activated. This means you can process payments for this store. - `Inactive`: the store is currently not active. - `InactiveWithModifications`: the store is currently not active, but payment modifications such as refunds are possible. - `Closed`: the store has been closed. + * @return status + **/ + @ApiModelProperty(value = "The status of the store: - `PreActive`: the store has been created, but not yet activated. - `Active`: the store has been activated. This means you can process payments for this store. - `Inactive`: the store is currently not active. - `InactiveWithModifications`: the store is currently not active, but payment modifications such as refunds are possible. - `Closed`: the store has been closed. ") + + public String getStatus() { + return status; + } + + + public void setStatus(String status) { + this.status = status; + } + + + public Store store(String store) { + + this.store = store; + return this; + } + + /** + * The code of the store. + * @return store + **/ + @ApiModelProperty(required = true, value = "The code of the store.") + + public String getStore() { + return store; + } + + + public void setStore(String store) { + this.store = store; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Store store = (Store) o; + return Objects.equals(this.address, store.address) && + Objects.equals(this.description, store.description) && + Objects.equals(this.inStoreTerminals, store.inStoreTerminals) && + Objects.equals(this.merchantAccountCode, store.merchantAccountCode) && + Objects.equals(this.status, store.status) && + Objects.equals(this.store, store.store); + } + + @Override + public int hashCode() { + return Objects.hash(address, description, inStoreTerminals, merchantAccountCode, status, store); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Store {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" inStoreTerminals: ").append(toIndentedString(inStoreTerminals)).append("\n"); + sb.append(" merchantAccountCode: ").append(toIndentedString(merchantAccountCode)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" store: ").append(toIndentedString(store)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("address"); + openapiFields.add("description"); + openapiFields.add("inStoreTerminals"); + openapiFields.add("merchantAccountCode"); + openapiFields.add("status"); + openapiFields.add("store"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("store"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Store + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Store.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Store is not found in the empty JSON string", Store.openapiRequiredFields.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"; + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Store.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Store` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } - return o.toString().replace("\n", "\n "); - } + } + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Store.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `address` + if (jsonObj.getAsJsonObject("address") != null) { + Address.validateJsonObject(jsonObj.getAsJsonObject("address")); + } + // validate the optional field description + if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // ensure the json data is an array + if (jsonObj.get("inStoreTerminals") != null && !jsonObj.get("inStoreTerminals").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `inStoreTerminals` to be an array in the JSON string but got `%s`", jsonObj.get("inStoreTerminals").toString())); + } + // validate the optional field merchantAccountCode + if (jsonObj.get("merchantAccountCode") != null && !jsonObj.get("merchantAccountCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `merchantAccountCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccountCode").toString())); + } + // validate the optional field status + if (jsonObj.get("status") != null && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + // validate the optional field store + if (jsonObj.get("store") != null && !jsonObj.get("store").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Store.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Store' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Store.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Store value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Store read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Store given an JSON string + * + * @param jsonString JSON string + * @return An instance of Store + * @throws IOException if the JSON string is invalid with respect to Store + */ + public static Store fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Store.class); + } + + /** + * Convert an instance of Store to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/src/main/java/com/adyen/service/BinLookup.java b/src/main/java/com/adyen/service/BinLookup.java deleted file mode 100644 index 876c719a6..000000000 --- a/src/main/java/com/adyen/service/BinLookup.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.adyen.service; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.model.binlookup.ThreeDSAvailabilityResponse; -import com.adyen.model.binlookup.CostEstimateResponse; -import com.adyen.model.binlookup.CostEstimateRequest; -import com.adyen.model.binlookup.ThreeDSAvailabilityRequest; - -import com.adyen.service.resource.binlookup.Get3dsAvailability; -import com.adyen.service.resource.binlookup.GetCostEstimate; - -public class BinLookup extends ApiKeyAuthenticatedService { - - private final Get3dsAvailability get3dsAvailability; - private final GetCostEstimate getCostEstimate; - - public BinLookup(Client client) { - super(client); - get3dsAvailability = new Get3dsAvailability(this); - getCostEstimate = new GetCostEstimate(this); - } - - - public ThreeDSAvailabilityResponse get3dsAvailability(ThreeDSAvailabilityRequest threeDSAvailabilityRequest) throws Exception { - String jsonRequest = threeDSAvailabilityRequest.toJson(); - String jsonResult = get3dsAvailability.request(jsonRequest); - return ThreeDSAvailabilityResponse.fromJson(jsonResult); - } - - public CostEstimateResponse getCostEstimate(CostEstimateRequest costEstimateRequest) throws Exception { - String jsonRequest = costEstimateRequest.toJson(); - String jsonResult = getCostEstimate.request(jsonRequest); - return CostEstimateResponse.fromJson(jsonResult); - } -} diff --git a/src/main/java/com/adyen/service/BinLookupApi.java b/src/main/java/com/adyen/service/BinLookupApi.java new file mode 100644 index 000000000..7525de991 --- /dev/null +++ b/src/main/java/com/adyen/service/BinLookupApi.java @@ -0,0 +1,92 @@ +/* + * Adyen BinLookup API + * The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning The BinLookup API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BinLookup/v54/get3dsAvailability ```## Going live To authneticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/BinLookup/v54/get3dsAvailability ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. + * + * The version of the OpenAPI document: 54 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.binlookup.CostEstimateRequest; +import com.adyen.model.binlookup.CostEstimateResponse; +import com.adyen.model.binlookup.ServiceError; +import com.adyen.model.binlookup.ThreeDSAvailabilityRequest; +import com.adyen.model.binlookup.ThreeDSAvailabilityResponse; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class BinLookupApi extends Service { + private final String baseURL; + + public BinLookupApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://pal-test.adyen.com/pal/servlet/BinLookup/v54"); + } + + /** + * Check if 3D Secure is available + * + * @param threeDSAvailabilityRequest {@link ThreeDSAvailabilityRequest } (required) + * @return {@link ThreeDSAvailabilityResponse } + * @throws ApiException if fails to make API call + */ + public ThreeDSAvailabilityResponse get3dsAvailability(ThreeDSAvailabilityRequest threeDSAvailabilityRequest) throws ApiException, IOException { + return get3dsAvailability(threeDSAvailabilityRequest, null); + } + + /** + * Check if 3D Secure is available + * + * @param threeDSAvailabilityRequest {@link ThreeDSAvailabilityRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ThreeDSAvailabilityResponse } + * @throws ApiException if fails to make API call + */ + public ThreeDSAvailabilityResponse get3dsAvailability(ThreeDSAvailabilityRequest threeDSAvailabilityRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = threeDSAvailabilityRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/get3dsAvailability", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return ThreeDSAvailabilityResponse.fromJson(jsonResult); + } + + /** + * Get a fees cost estimate + * + * @param costEstimateRequest {@link CostEstimateRequest } (required) + * @return {@link CostEstimateResponse } + * @throws ApiException if fails to make API call + */ + public CostEstimateResponse getCostEstimate(CostEstimateRequest costEstimateRequest) throws ApiException, IOException { + return getCostEstimate(costEstimateRequest, null); + } + + /** + * Get a fees cost estimate + * + * @param costEstimateRequest {@link CostEstimateRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CostEstimateResponse } + * @throws ApiException if fails to make API call + */ + public CostEstimateResponse getCostEstimate(CostEstimateRequest costEstimateRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = costEstimateRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/getCostEstimate", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return CostEstimateResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/Payment.java b/src/main/java/com/adyen/service/Payment.java deleted file mode 100644 index 9e3b963a0..000000000 --- a/src/main/java/com/adyen/service/Payment.java +++ /dev/null @@ -1,308 +0,0 @@ -/* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ - * - * Adyen Java API Library - * - * Copyright (c) 2017 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. - */ -package com.adyen.service; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.model.RequestOptions; -import com.adyen.model.payments.AdjustAuthorisationRequest; -import com.adyen.model.payments.ApplicationInfo; -import com.adyen.model.payments.AuthenticationResultRequest; -import com.adyen.model.payments.AuthenticationResultResponse; -import com.adyen.model.payments.CancelOrRefundRequest; -import com.adyen.model.payments.CancelRequest; -import com.adyen.model.payments.CaptureRequest; -import com.adyen.model.payments.CommonField; -import com.adyen.model.payments.DonationRequest; -import com.adyen.model.payments.ModificationResult; -import com.adyen.model.payments.PaymentRequest; -import com.adyen.model.payments.PaymentRequest3d; -import com.adyen.model.payments.PaymentRequest3ds2; -import com.adyen.model.payments.PaymentResult; -import com.adyen.model.payments.RefundRequest; -import com.adyen.model.payments.TechnicalCancelRequest; -import com.adyen.model.payments.ThreeDS2ResultRequest; -import com.adyen.model.payments.ThreeDS2ResultResponse; -import com.adyen.model.payments.VoidPendingRefundRequest; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.PaymentResource; - -import java.io.IOException; -import java.util.Optional; - -import static com.adyen.Client.LIB_NAME; -import static com.adyen.Client.LIB_VERSION; - -public class Payment extends Service { - - private final PaymentResource authorise; - private final PaymentResource authorise3D; - private final PaymentResource authorise3DS2; - private final PaymentResource retrieve3DS2Result; - private final PaymentResource getAuthenticationResult; - private final PaymentResource capture; - private final PaymentResource cancel; - private final PaymentResource refund; - private final PaymentResource cancelOrRefund; - private final PaymentResource technicalCancel; - private final PaymentResource adjustAuthorisation; - private final PaymentResource donate; - private final PaymentResource voidPendingRefund; - - public Payment(Client client) { - super(client); - - authorise = new PaymentResource(this, "/authorise"); - authorise3D = new PaymentResource(this, "/authorise3d"); - authorise3DS2 = new PaymentResource(this, "/authorise3ds2"); - retrieve3DS2Result = new PaymentResource(this, "/retrieve3ds2Result"); - getAuthenticationResult = new PaymentResource(this, "/getAuthenticationResult"); - capture = new PaymentResource(this, "/capture"); - cancel = new PaymentResource(this, "/cancel"); - refund = new PaymentResource(this, "/refund"); - cancelOrRefund = new PaymentResource(this, "/cancelOrRefund"); - technicalCancel = new PaymentResource(this, "/technicalCancel"); - adjustAuthorisation = new PaymentResource(this, "/adjustAuthorisation"); - donate = new PaymentResource(this, "/donate"); - voidPendingRefund = new PaymentResource(this, "/voidPendingRefund"); - } - - /** - * POST /authorise API call - * - * @param paymentRequest paymentRequest - * @return PaymentResult - * @throws ApiException ApiException - * @throws IOException IOException - */ - public PaymentResult authorise(PaymentRequest paymentRequest) throws ApiException, IOException { - return authorise(paymentRequest, null); - } - - public PaymentResult authorise(PaymentRequest paymentRequest, RequestOptions requestOptions) throws ApiException, IOException { - paymentRequest.setApplicationInfo(addLibrary(paymentRequest.getApplicationInfo())); - String jsonRequest = paymentRequest.toJson(); - String jsonResult = authorise.request(jsonRequest, requestOptions); - return PaymentResult.fromJson(jsonResult); - } - - /** - * POST /authorise3d API call - * - * @param paymentRequest3d authorise3D - * @return PaymentResult - * @throws Exception Exception - */ - public PaymentResult authorise3D(PaymentRequest3d paymentRequest3d) throws Exception { - paymentRequest3d.setApplicationInfo(addLibrary(paymentRequest3d.getApplicationInfo())); - String jsonRequest = paymentRequest3d.toJson(); - - String jsonResult = authorise3D.request(jsonRequest); - - return PaymentResult.fromJson(jsonResult); - } - - /** - * POST /authorise3ds2 API call - * - * @param paymentRequest3ds2 PaymentRequest3ds2 - * @return PaymentResult - * @throws Exception Exception - */ - public PaymentResult authorise3DS2(PaymentRequest3ds2 paymentRequest3ds2) throws Exception { - paymentRequest3ds2.setApplicationInfo(addLibrary(paymentRequest3ds2.getApplicationInfo())); - String jsonRequest = paymentRequest3ds2.toJson(); - - String jsonResult = authorise3DS2.request(jsonRequest); - - return PaymentResult.fromJson(jsonResult); - } - - /** - * POST /retrieve3ds2Result API call - * - * @deprecated Use /getAuthenticationResult instead - * @param threeDS2ResultRequest PaymentRequest3ds2 - * @return PaymentResult - * @throws Exception Exception - */ - @Deprecated - public ThreeDS2ResultResponse retrieve3ds2Result(ThreeDS2ResultRequest threeDS2ResultRequest) throws Exception { - String jsonRequest = threeDS2ResultRequest.toJson(); - - String jsonResult = retrieve3DS2Result.request(jsonRequest); - - return ThreeDS2ResultResponse.fromJson(jsonResult); - } - - /** - * POST /getAuthenticationResult API call - * - * @param authenticationResultRequest AuthenticationResultRequest - * @return AuthenticationResultResponse - * @throws ApiException ApiException - * @throws IOException IOException - */ - public AuthenticationResultResponse getAuthenticationResult(AuthenticationResultRequest authenticationResultRequest) throws IOException, ApiException { - String jsonRequest = authenticationResultRequest.toJson(); - - String jsonResult = getAuthenticationResult.request(jsonRequest); - - return AuthenticationResultResponse.fromJson(jsonResult); - } - - /** - * Overwrite library version - */ - private ApplicationInfo addLibrary(ApplicationInfo applicationInfo) { - return Optional.ofNullable(applicationInfo) - .orElse(new ApplicationInfo()) - .adyenLibrary(new CommonField().name(LIB_NAME).version(LIB_VERSION)); - } - - /** - * POST /capture API call - * - * @param captureRequest CaptureRequest - * @return ModificationResult - * @throws ApiException ApiException - * @throws IOException IOException - */ - public ModificationResult capture(CaptureRequest captureRequest) throws IOException, ApiException { - String jsonRequest = captureRequest.toJson(); - - String jsonResult = capture.request(jsonRequest); - - return ModificationResult.fromJson(jsonResult); - } - - /** - * POST /cancel API call - * - * @param cancelRequest CancelRequest - * @return ModificationResult - * @throws ApiException ApiException - * @throws IOException IOException - */ - public ModificationResult cancel(CancelRequest cancelRequest) throws IOException, ApiException { - String jsonRequest = cancelRequest.toJson(); - - String jsonResult = cancel.request(jsonRequest); - - return ModificationResult.fromJson(jsonResult); - } - - /** - * POST /refund API call - * - * @param refundRequest RefundRequest - * @return ModificationResult - * @throws ApiException ApiException - * @throws IOException IOException - */ - public ModificationResult refund(RefundRequest refundRequest) throws IOException, ApiException { - String jsonRequest = refundRequest.toJson(); - - String jsonResult = refund.request(jsonRequest); - - return ModificationResult.fromJson(jsonResult); - } - - /** - * POST /cancelOrRefund API call - * - * @param cancelOrRefundRequest CancelOrRefundRequest - * @return ModificationResult - * @throws ApiException ApiException - * @throws IOException IOException - */ - public ModificationResult cancelOrRefund(CancelOrRefundRequest cancelOrRefundRequest) throws IOException, ApiException { - String jsonRequest = cancelOrRefundRequest.toJson(); - - String jsonResult = cancelOrRefund.request(jsonRequest); - - return ModificationResult.fromJson(jsonResult); - } - - /** - * POST /technicalCancel API call - * - * @param technicalCancelRequest TechnicalCancelRequest - * @return ModificationResult - * @throws ApiException ApiException - * @throws IOException IOException - */ - public ModificationResult technicalCancel(TechnicalCancelRequest technicalCancelRequest) throws IOException, ApiException { - String jsonRequest = technicalCancelRequest.toJson(); - - String jsonResult = technicalCancel.request(jsonRequest); - - return ModificationResult.fromJson(jsonResult); - } - - /** - * POST /adjustAuthorisation API call - * - * @param adjustAuthorisationRequest AdjustAuthorisationRequest - * @return ModificationResult - * @throws ApiException ApiException - * @throws IOException IOException - */ - public ModificationResult adjustAuthorisation(AdjustAuthorisationRequest adjustAuthorisationRequest) throws IOException, ApiException { - String jsonRequest = adjustAuthorisationRequest.toJson(); - - String jsonResult = adjustAuthorisation.request(jsonRequest); - - return ModificationResult.fromJson(jsonResult); - } - - /** - * POST /donate API call - * - * @param donationRequest DonationRequest - * @return ModificationResult - * @throws ApiException ApiException - * @throws IOException IOException - */ - public ModificationResult donate(DonationRequest donationRequest) throws IOException, ApiException { - String jsonRequest = donationRequest.toJson(); - - String jsonResult = donate.request(jsonRequest); - - return ModificationResult.fromJson(jsonResult); - } - - /** - * POST /voidPendingRefund API call - * - * @param voidPendingRefundRequest VoidPendingRefundRequest - * @return ModificationResult - * @throws ApiException ApiException - * @throws IOException IOException - */ - public ModificationResult voidPendingRefund(VoidPendingRefundRequest voidPendingRefundRequest) throws IOException, ApiException { - String jsonRequest = voidPendingRefundRequest.toJson(); - - String jsonResult = voidPendingRefund.request(jsonRequest); - - return ModificationResult.fromJson(jsonResult); - } -} diff --git a/src/main/java/com/adyen/service/PaymentApi.java b/src/main/java/com/adyen/service/PaymentApi.java new file mode 100644 index 000000000..ac101ac19 --- /dev/null +++ b/src/main/java/com/adyen/service/PaymentApi.java @@ -0,0 +1,402 @@ +/* + * Adyen Payment API + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API. If using an API key, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication, for example: ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ``` ## Going live To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area. The live endpoint URLs contain a prefix which is unique to your company account: ``` https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ``` Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**. + * + * The version of the OpenAPI document: 68 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.payment.AdjustAuthorisationRequest; +import com.adyen.model.payment.AuthenticationResultRequest; +import com.adyen.model.payment.AuthenticationResultResponse; +import com.adyen.model.payment.CancelOrRefundRequest; +import com.adyen.model.payment.CancelRequest; +import com.adyen.model.payment.CaptureRequest; +import com.adyen.model.payment.DonationRequest; +import com.adyen.model.payment.ModificationResult; +import com.adyen.model.payment.PaymentRequest; +import com.adyen.model.payment.PaymentRequest3d; +import com.adyen.model.payment.PaymentRequest3ds2; +import com.adyen.model.payment.PaymentResult; +import com.adyen.model.payment.RefundRequest; +import com.adyen.model.payment.ServiceError; +import com.adyen.model.payment.TechnicalCancelRequest; +import com.adyen.model.payment.ThreeDS2ResultRequest; +import com.adyen.model.payment.ThreeDS2ResultResponse; +import com.adyen.model.payment.VoidPendingRefundRequest; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class PaymentApi extends Service { + private final String baseURL; + + public PaymentApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://pal-test.adyen.com/pal/servlet/Payment/v68"); + } + + /** + * Change the authorised amount + * + * @param adjustAuthorisationRequest {@link AdjustAuthorisationRequest } (required) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult adjustAuthorisation(AdjustAuthorisationRequest adjustAuthorisationRequest) throws ApiException, IOException { + return adjustAuthorisation(adjustAuthorisationRequest, null); + } + + /** + * Change the authorised amount + * + * @param adjustAuthorisationRequest {@link AdjustAuthorisationRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult adjustAuthorisation(AdjustAuthorisationRequest adjustAuthorisationRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = adjustAuthorisationRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/adjustAuthorisation", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return ModificationResult.fromJson(jsonResult); + } + + /** + * Create an authorisation + * + * @param paymentRequest {@link PaymentRequest } (required) + * @return {@link PaymentResult } + * @throws ApiException if fails to make API call + */ + public PaymentResult authorise(PaymentRequest paymentRequest) throws ApiException, IOException { + return authorise(paymentRequest, null); + } + + /** + * Create an authorisation + * + * @param paymentRequest {@link PaymentRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentResult } + * @throws ApiException if fails to make API call + */ + public PaymentResult authorise(PaymentRequest paymentRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = paymentRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/authorise", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return PaymentResult.fromJson(jsonResult); + } + + /** + * Complete a 3DS authorisation + * + * @param paymentRequest3d {@link PaymentRequest3d } (required) + * @return {@link PaymentResult } + * @throws ApiException if fails to make API call + */ + public PaymentResult authorise3d(PaymentRequest3d paymentRequest3d) throws ApiException, IOException { + return authorise3d(paymentRequest3d, null); + } + + /** + * Complete a 3DS authorisation + * + * @param paymentRequest3d {@link PaymentRequest3d } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentResult } + * @throws ApiException if fails to make API call + */ + public PaymentResult authorise3d(PaymentRequest3d paymentRequest3d, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = paymentRequest3d.toJson(); + Resource resource = new Resource(this, this.baseURL + "/authorise3d", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return PaymentResult.fromJson(jsonResult); + } + + /** + * Complete a 3DS2 authorisation + * + * @param paymentRequest3ds2 {@link PaymentRequest3ds2 } (required) + * @return {@link PaymentResult } + * @throws ApiException if fails to make API call + */ + public PaymentResult authorise3ds2(PaymentRequest3ds2 paymentRequest3ds2) throws ApiException, IOException { + return authorise3ds2(paymentRequest3ds2, null); + } + + /** + * Complete a 3DS2 authorisation + * + * @param paymentRequest3ds2 {@link PaymentRequest3ds2 } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentResult } + * @throws ApiException if fails to make API call + */ + public PaymentResult authorise3ds2(PaymentRequest3ds2 paymentRequest3ds2, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = paymentRequest3ds2.toJson(); + Resource resource = new Resource(this, this.baseURL + "/authorise3ds2", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return PaymentResult.fromJson(jsonResult); + } + + /** + * Cancel an authorisation + * + * @param cancelRequest {@link CancelRequest } (required) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult cancel(CancelRequest cancelRequest) throws ApiException, IOException { + return cancel(cancelRequest, null); + } + + /** + * Cancel an authorisation + * + * @param cancelRequest {@link CancelRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult cancel(CancelRequest cancelRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = cancelRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/cancel", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return ModificationResult.fromJson(jsonResult); + } + + /** + * Cancel or refund a payment + * + * @param cancelOrRefundRequest {@link CancelOrRefundRequest } (required) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult cancelOrRefund(CancelOrRefundRequest cancelOrRefundRequest) throws ApiException, IOException { + return cancelOrRefund(cancelOrRefundRequest, null); + } + + /** + * Cancel or refund a payment + * + * @param cancelOrRefundRequest {@link CancelOrRefundRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult cancelOrRefund(CancelOrRefundRequest cancelOrRefundRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = cancelOrRefundRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/cancelOrRefund", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return ModificationResult.fromJson(jsonResult); + } + + /** + * Capture an authorisation + * + * @param captureRequest {@link CaptureRequest } (required) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult capture(CaptureRequest captureRequest) throws ApiException, IOException { + return capture(captureRequest, null); + } + + /** + * Capture an authorisation + * + * @param captureRequest {@link CaptureRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult capture(CaptureRequest captureRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = captureRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/capture", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return ModificationResult.fromJson(jsonResult); + } + + /** + * Create a donation + * + * @param donationRequest {@link DonationRequest } (required) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult donate(DonationRequest donationRequest) throws ApiException, IOException { + return donate(donationRequest, null); + } + + /** + * Create a donation + * + * @param donationRequest {@link DonationRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult donate(DonationRequest donationRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = donationRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/donate", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return ModificationResult.fromJson(jsonResult); + } + + /** + * Get the 3DS authentication result + * + * @param authenticationResultRequest {@link AuthenticationResultRequest } (required) + * @return {@link AuthenticationResultResponse } + * @throws ApiException if fails to make API call + */ + public AuthenticationResultResponse getAuthenticationResult(AuthenticationResultRequest authenticationResultRequest) throws ApiException, IOException { + return getAuthenticationResult(authenticationResultRequest, null); + } + + /** + * Get the 3DS authentication result + * + * @param authenticationResultRequest {@link AuthenticationResultRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AuthenticationResultResponse } + * @throws ApiException if fails to make API call + */ + public AuthenticationResultResponse getAuthenticationResult(AuthenticationResultRequest authenticationResultRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = authenticationResultRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/getAuthenticationResult", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return AuthenticationResultResponse.fromJson(jsonResult); + } + + /** + * Refund a captured payment + * + * @param refundRequest {@link RefundRequest } (required) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult refund(RefundRequest refundRequest) throws ApiException, IOException { + return refund(refundRequest, null); + } + + /** + * Refund a captured payment + * + * @param refundRequest {@link RefundRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult refund(RefundRequest refundRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = refundRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/refund", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return ModificationResult.fromJson(jsonResult); + } + + /** + * Get the 3DS2 authentication result + * + * @param threeDS2ResultRequest {@link ThreeDS2ResultRequest } (required) + * @return {@link ThreeDS2ResultResponse } + * @throws ApiException if fails to make API call + */ + public ThreeDS2ResultResponse retrieve3ds2Result(ThreeDS2ResultRequest threeDS2ResultRequest) throws ApiException, IOException { + return retrieve3ds2Result(threeDS2ResultRequest, null); + } + + /** + * Get the 3DS2 authentication result + * + * @param threeDS2ResultRequest {@link ThreeDS2ResultRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ThreeDS2ResultResponse } + * @throws ApiException if fails to make API call + */ + public ThreeDS2ResultResponse retrieve3ds2Result(ThreeDS2ResultRequest threeDS2ResultRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = threeDS2ResultRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/retrieve3ds2Result", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return ThreeDS2ResultResponse.fromJson(jsonResult); + } + + /** + * Cancel an authorisation using your reference + * + * @param technicalCancelRequest {@link TechnicalCancelRequest } (required) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult technicalCancel(TechnicalCancelRequest technicalCancelRequest) throws ApiException, IOException { + return technicalCancel(technicalCancelRequest, null); + } + + /** + * Cancel an authorisation using your reference + * + * @param technicalCancelRequest {@link TechnicalCancelRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult technicalCancel(TechnicalCancelRequest technicalCancelRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = technicalCancelRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/technicalCancel", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return ModificationResult.fromJson(jsonResult); + } + + /** + * Cancel an in-person refund + * + * @param voidPendingRefundRequest {@link VoidPendingRefundRequest } (required) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult voidPendingRefund(VoidPendingRefundRequest voidPendingRefundRequest) throws ApiException, IOException { + return voidPendingRefund(voidPendingRefundRequest, null); + } + + /** + * Cancel an in-person refund + * + * @param voidPendingRefundRequest {@link VoidPendingRefundRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link ModificationResult } + * @throws ApiException if fails to make API call + */ + public ModificationResult voidPendingRefund(VoidPendingRefundRequest voidPendingRefundRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = voidPendingRefundRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/voidPendingRefund", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return ModificationResult.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/PosTerminalManagement.java b/src/main/java/com/adyen/service/PosTerminalManagement.java deleted file mode 100644 index 9ae0a3ffd..000000000 --- a/src/main/java/com/adyen/service/PosTerminalManagement.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * ###### - * ###### - * ############ ####( ###### #####. ###### ############ ############ - * ############# #####( ###### #####. ###### ############# ############# - * ###### #####( ###### #####. ###### ##### ###### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### - * ###### ###### #####( ###### #####. ###### ##### ##### ###### - * ############# ############# ############# ############# ##### ###### - * ############ ############ ############# ############ ##### ###### - * ###### - * ############# - * ############ - * - * Adyen Java API Library - * - * Copyright (c) 2020 Adyen B.V. - * This file is open source and available under the MIT license. - * See the LICENSE file for more info. - */ - -package com.adyen.service; - -import com.adyen.ApiKeyAuthenticatedService; -import com.adyen.Client; -import com.adyen.model.posterminalmanagement.AssignTerminalsRequest; -import com.adyen.model.posterminalmanagement.AssignTerminalsResponse; -import com.adyen.model.posterminalmanagement.FindTerminalRequest; -import com.adyen.model.posterminalmanagement.FindTerminalResponse; -import com.adyen.model.posterminalmanagement.GetStoresUnderAccountRequest; -import com.adyen.model.posterminalmanagement.GetStoresUnderAccountResponse; -import com.adyen.model.posterminalmanagement.GetTerminalDetailsRequest; -import com.adyen.model.posterminalmanagement.GetTerminalDetailsResponse; -import com.adyen.model.posterminalmanagement.GetTerminalsUnderAccountRequest; -import com.adyen.model.posterminalmanagement.GetTerminalsUnderAccountResponse; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.posterminalmanagement.AssignTerminals; -import com.adyen.service.resource.posterminalmanagement.FindTerminal; -import com.adyen.service.resource.posterminalmanagement.GetStoresUnderAccount; -import com.adyen.service.resource.posterminalmanagement.GetTerminalDetails; -import com.adyen.service.resource.posterminalmanagement.GetTerminalsUnderAccount; -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - -public class PosTerminalManagement extends ApiKeyAuthenticatedService { - - private final AssignTerminals assignTerminals; - private final FindTerminal findTerminal; - private final GetTerminalsUnderAccount getTerminalsUnderAccount; - private final GetStoresUnderAccount getStoresUnderAccount; - private final GetTerminalDetails getTerminalDetails; - - public PosTerminalManagement(Client client) { - - super(client); - assignTerminals = new AssignTerminals(this); - findTerminal = new FindTerminal(this); - getTerminalsUnderAccount = new GetTerminalsUnderAccount(this); - getStoresUnderAccount = new GetStoresUnderAccount(this); - getTerminalDetails = new GetTerminalDetails(this); - } - - /** - * POST /assignTerminals API call - * - * @param assignTerminalsRequest - * @return - * @throws ApiException - * @throws IOException - */ - public AssignTerminalsResponse assignTerminals(AssignTerminalsRequest assignTerminalsRequest) throws ApiException, IOException { - String jsonRequest = GSON.toJson(assignTerminalsRequest); - String jsonResult = assignTerminals.request(jsonRequest); - return GSON.fromJson(jsonResult, new TypeToken() { - }.getType()); - } - - /** - * POST /findTerminal API call - * - * @param findTerminalRequest - * @return - * @throws ApiException - * @throws IOException - */ - public FindTerminalResponse findTerminal(FindTerminalRequest findTerminalRequest) throws ApiException, IOException { - String jsonRequest = GSON.toJson(findTerminalRequest); - String jsonResult = findTerminal.request(jsonRequest); - return GSON.fromJson(jsonResult, new TypeToken() { - }.getType()); - } - - /** - * POST /getTerminalsUnderAccount API call - * - * @param getTerminalsUnderAccountRequest - * @return - * @throws ApiException - * @throws IOException - */ - public GetTerminalsUnderAccountResponse getTerminalsUnderAccount(GetTerminalsUnderAccountRequest getTerminalsUnderAccountRequest) throws ApiException, IOException { - String jsonRequest = GSON.toJson(getTerminalsUnderAccountRequest); - String jsonResult = getTerminalsUnderAccount.request(jsonRequest); - return GSON.fromJson(jsonResult, new TypeToken() { - }.getType()); - } - - - /** - * POST /getStoresUnderAccount API call - * - * @param getStoresUnderAccountRequest - * @return - * @throws ApiException - * @throws IOException - */ - public GetStoresUnderAccountResponse getStoresUnderAccount(GetStoresUnderAccountRequest getStoresUnderAccountRequest) throws ApiException, IOException { - String jsonRequest = GSON.toJson(getStoresUnderAccountRequest); - String jsonResult = getStoresUnderAccount.request(jsonRequest); - return GSON.fromJson(jsonResult, new TypeToken() { - }.getType()); - } - - /** - * POST /getTerminalDetails API call - * - * @param getTerminalDetailsRequest - * @return - * @throws ApiException - * @throws IOException - */ - public GetTerminalDetailsResponse getTerminalDetails(GetTerminalDetailsRequest getTerminalDetailsRequest) throws ApiException, IOException { - String jsonRequest = GSON.toJson(getTerminalDetailsRequest); - String jsonResult = getTerminalDetails.request(jsonRequest); - return GSON.fromJson(jsonResult, new TypeToken() { - }.getType()); - } - -} diff --git a/src/main/java/com/adyen/service/PosTerminalManagementApi.java b/src/main/java/com/adyen/service/PosTerminalManagementApi.java new file mode 100644 index 000000000..71430b5b8 --- /dev/null +++ b/src/main/java/com/adyen/service/PosTerminalManagementApi.java @@ -0,0 +1,179 @@ +/* + * POS Terminal Management API + * This API provides endpoints for managing your point-of-sale (POS) payment terminals. You can use the API to obtain information about a specific terminal, retrieve overviews of your terminals and stores, and assign terminals to a merchant account or store. For more information, refer to [Assign terminals](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api). ## Authentication Each request to the Terminal Management API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_API_key\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Terminal Management API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://postfmapi-test.adyen.com/postfmapi/terminal/v1/getTerminalsUnderAccount ``` When using versioned endpoints, Boolean response values are returned in string format: `\"true\"` or `\"false\"`. If you omit the version from the endpoint URL, Boolean response values are returned like this: `true` or `false`. + * + * The version of the OpenAPI document: 1 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.posterminalmanagement.AssignTerminalsRequest; +import com.adyen.model.posterminalmanagement.AssignTerminalsResponse; +import com.adyen.model.posterminalmanagement.FindTerminalRequest; +import com.adyen.model.posterminalmanagement.FindTerminalResponse; +import com.adyen.model.posterminalmanagement.GetStoresUnderAccountRequest; +import com.adyen.model.posterminalmanagement.GetStoresUnderAccountResponse; +import com.adyen.model.posterminalmanagement.GetTerminalDetailsRequest; +import com.adyen.model.posterminalmanagement.GetTerminalDetailsResponse; +import com.adyen.model.posterminalmanagement.GetTerminalsUnderAccountRequest; +import com.adyen.model.posterminalmanagement.GetTerminalsUnderAccountResponse; +import com.adyen.model.posterminalmanagement.ServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class PosTerminalManagementApi extends Service { + private final String baseURL; + + public PosTerminalManagementApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://postfmapi-test.adyen.com/postfmapi/terminal/v1"); + } + + /** + * Assign terminals + * + * @param assignTerminalsRequest {@link AssignTerminalsRequest } (required) + * @return {@link AssignTerminalsResponse } + * @throws ApiException if fails to make API call + */ + public AssignTerminalsResponse assignTerminals(AssignTerminalsRequest assignTerminalsRequest) throws ApiException, IOException { + return assignTerminals(assignTerminalsRequest, null); + } + + /** + * Assign terminals + * + * @param assignTerminalsRequest {@link AssignTerminalsRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AssignTerminalsResponse } + * @throws ApiException if fails to make API call + */ + public AssignTerminalsResponse assignTerminals(AssignTerminalsRequest assignTerminalsRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = assignTerminalsRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/assignTerminals", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return AssignTerminalsResponse.fromJson(jsonResult); + } + + /** + * Get the account or store of a terminal + * + * @param findTerminalRequest {@link FindTerminalRequest } (required) + * @return {@link FindTerminalResponse } + * @throws ApiException if fails to make API call + */ + public FindTerminalResponse findTerminal(FindTerminalRequest findTerminalRequest) throws ApiException, IOException { + return findTerminal(findTerminalRequest, null); + } + + /** + * Get the account or store of a terminal + * + * @param findTerminalRequest {@link FindTerminalRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link FindTerminalResponse } + * @throws ApiException if fails to make API call + */ + public FindTerminalResponse findTerminal(FindTerminalRequest findTerminalRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = findTerminalRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/findTerminal", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return FindTerminalResponse.fromJson(jsonResult); + } + + /** + * Get the stores of an account + * + * @param getStoresUnderAccountRequest {@link GetStoresUnderAccountRequest } (required) + * @return {@link GetStoresUnderAccountResponse } + * @throws ApiException if fails to make API call + */ + public GetStoresUnderAccountResponse getStoresUnderAccount(GetStoresUnderAccountRequest getStoresUnderAccountRequest) throws ApiException, IOException { + return getStoresUnderAccount(getStoresUnderAccountRequest, null); + } + + /** + * Get the stores of an account + * + * @param getStoresUnderAccountRequest {@link GetStoresUnderAccountRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GetStoresUnderAccountResponse } + * @throws ApiException if fails to make API call + */ + public GetStoresUnderAccountResponse getStoresUnderAccount(GetStoresUnderAccountRequest getStoresUnderAccountRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = getStoresUnderAccountRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/getStoresUnderAccount", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return GetStoresUnderAccountResponse.fromJson(jsonResult); + } + + /** + * Get the details of a terminal + * + * @param getTerminalDetailsRequest {@link GetTerminalDetailsRequest } (required) + * @return {@link GetTerminalDetailsResponse } + * @throws ApiException if fails to make API call + */ + public GetTerminalDetailsResponse getTerminalDetails(GetTerminalDetailsRequest getTerminalDetailsRequest) throws ApiException, IOException { + return getTerminalDetails(getTerminalDetailsRequest, null); + } + + /** + * Get the details of a terminal + * + * @param getTerminalDetailsRequest {@link GetTerminalDetailsRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GetTerminalDetailsResponse } + * @throws ApiException if fails to make API call + */ + public GetTerminalDetailsResponse getTerminalDetails(GetTerminalDetailsRequest getTerminalDetailsRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = getTerminalDetailsRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/getTerminalDetails", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return GetTerminalDetailsResponse.fromJson(jsonResult); + } + + /** + * Get the list of terminals + * + * @param getTerminalsUnderAccountRequest {@link GetTerminalsUnderAccountRequest } (required) + * @return {@link GetTerminalsUnderAccountResponse } + * @throws ApiException if fails to make API call + */ + public GetTerminalsUnderAccountResponse getTerminalsUnderAccount(GetTerminalsUnderAccountRequest getTerminalsUnderAccountRequest) throws ApiException, IOException { + return getTerminalsUnderAccount(getTerminalsUnderAccountRequest, null); + } + + /** + * Get the list of terminals + * + * @param getTerminalsUnderAccountRequest {@link GetTerminalsUnderAccountRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GetTerminalsUnderAccountResponse } + * @throws ApiException if fails to make API call + */ + public GetTerminalsUnderAccountResponse getTerminalsUnderAccount(GetTerminalsUnderAccountRequest getTerminalsUnderAccountRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = getTerminalsUnderAccountRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/getTerminalsUnderAccount", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return GetTerminalsUnderAccountResponse.fromJson(jsonResult); + } +} diff --git a/src/test/java/com/adyen/BaseTest.java b/src/test/java/com/adyen/BaseTest.java index 3618a3cb0..5839be53e 100644 --- a/src/test/java/com/adyen/BaseTest.java +++ b/src/test/java/com/adyen/BaseTest.java @@ -33,18 +33,18 @@ import com.adyen.model.nexo.SaleData; import com.adyen.model.nexo.SaleToPOIRequest; import com.adyen.model.nexo.TransactionIdentification; -import com.adyen.model.payments.ApplicationInfo; -import com.adyen.model.payments.AuthenticationResultRequest; -import com.adyen.model.payments.BrowserInfo; -import com.adyen.model.payments.Card; -import com.adyen.model.payments.CommonField; -import com.adyen.model.payments.Name; -import com.adyen.model.payments.PaymentRequest3d; -import com.adyen.model.payments.PaymentRequest3ds2; -import com.adyen.model.payments.ThreeDS2RequestData; +import com.adyen.model.payment.ApplicationInfo; +import com.adyen.model.payment.AuthenticationResultRequest; +import com.adyen.model.payment.BrowserInfo; +import com.adyen.model.payment.Card; +import com.adyen.model.payment.CommonField; +import com.adyen.model.payment.Name; +import com.adyen.model.payment.PaymentRequest3d; +import com.adyen.model.payment.PaymentRequest3ds2; +import com.adyen.model.payment.ThreeDS2RequestData; import com.adyen.model.terminal.TerminalAPIRequest; import com.adyen.model.additionalData.InvoiceLine; -import com.adyen.model.payments.PaymentRequest; +import com.adyen.model.payment.PaymentRequest; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -166,7 +166,7 @@ protected PaymentRequest createFullCardPaymentRequest() { card.setNumber("5136333333333335"); card.setCvc("737"); return createBasePaymentRequest(new PaymentRequest()).reference("123456") - .amount(new com.adyen.model.payments.Amount().value(100000L).currency("EUR")) + .amount(new com.adyen.model.payment.Amount().value(100000L).currency("EUR")) .card(card); } @@ -178,7 +178,7 @@ protected PaymentRequest createOpenInvoicePaymentRequest() { OffsetDateTime date = OffsetDateTime.parse("1970-07-10T12:00:00+01:00"); PaymentRequest paymentRequest = createBasePaymentRequest(new PaymentRequest()).reference("123456"); - paymentRequest.amount(new com.adyen.model.payments.Amount().value(200L).currency("EUR")); + paymentRequest.amount(new com.adyen.model.payment.Amount().value(200L).currency("EUR")); // Set Shopper Data paymentRequest.setShopperEmail("youremail@email.com"); @@ -193,7 +193,7 @@ protected PaymentRequest createOpenInvoicePaymentRequest() { paymentRequest.setShopperName(shopperName); // Set Billing and Delivery address - com.adyen.model.payments.Address address = new com.adyen.model.payments.Address(); + com.adyen.model.payment.Address address = new com.adyen.model.payment.Address(); address.setCity("Gravenhage"); address.setCountry("NL"); address.setHouseNumberOrName("1"); @@ -278,7 +278,7 @@ protected PaymentRequest createCSEPaymentRequest() { additionalData.put(ApiConstants.AdditionalData.Card.Encrypted.JSON, "adyenjs_0_1_4p1$..."); return createBasePaymentRequest(new PaymentRequest()).reference("123456") .additionalData(additionalData) - .amount(new com.adyen.model.payments.Amount().value(100000L).currency("EUR")); + .amount(new com.adyen.model.payment.Amount().value(100000L).currency("EUR")); } /** diff --git a/src/test/java/com/adyen/BinLookupTest.java b/src/test/java/com/adyen/BinLookupTest.java index 0ecbc868b..b4f396aaa 100644 --- a/src/test/java/com/adyen/BinLookupTest.java +++ b/src/test/java/com/adyen/BinLookupTest.java @@ -21,7 +21,7 @@ package com.adyen; import com.adyen.model.binlookup.*; -import com.adyen.service.BinLookup; +import com.adyen.service.BinLookupApi; import com.adyen.service.exception.ApiException; import org.junit.Test; @@ -42,7 +42,7 @@ public class BinLookupTest extends BaseTest { @Test public void TestGet3dsAvailabilitySuccessMocked() throws Exception { Client client = createMockClientFromFile("mocks/binlookup/get3dsAvailability-200-success.json"); - BinLookup binLookup = new BinLookup(client); + BinLookupApi binLookup = new BinLookupApi(client); ThreeDSAvailabilityRequest threeDSAvailabilityRequest = new ThreeDSAvailabilityRequest(); threeDSAvailabilityRequest.setMerchantAccount("merchantAccount"); @@ -57,7 +57,7 @@ public void TestGet3dsAvailabilitySuccessMocked() throws Exception { @Test public void TestGet3dsAvailabilityInvalidMerchantMocked() throws Exception { Client client = createMockClientForErrors(403, "mocks/binlookup/get3dsavailability-error-merchant.json"); - BinLookup binLookup = new BinLookup(client); + BinLookupApi binLookup = new BinLookupApi(client); ThreeDSAvailabilityRequest threeDSAvailabilityRequest = new ThreeDSAvailabilityRequest(); threeDSAvailabilityRequest.setMerchantAccount(null); @@ -76,12 +76,12 @@ public void TestGet3dsAvailabilityInvalidMerchantMocked() throws Exception { public void TestGetCostEstimateSuccessMocked() throws Exception { Client client = createMockClientFromFile("mocks/binlookup/getCostEstimate-getCostEstimate-200.json"); - BinLookup binLookup = new BinLookup(client); + BinLookupApi binLookup = new BinLookupApi(client); CostEstimateRequest costEstimateRequest = new CostEstimateRequest(); Amount amount = new Amount(); amount.setCurrency("EUR"); - amount.setValue(new Long("1000")); + amount.setValue(Long.valueOf("1000")); costEstimateRequest.setAmount(amount); CostEstimateAssumptions costEstimateAssumptions = new CostEstimateAssumptions(); @@ -109,12 +109,12 @@ public void TestGetCostEstimateSuccessMocked() throws Exception { @Test public void TestGetCostEstimateInvalidMerchantMocked() throws Exception { Client client = createMockClientForErrors(500, "mocks/binlookup/getcostestimate-error-merchant.json"); - BinLookup binLookup = new BinLookup(client); + BinLookupApi binLookup = new BinLookupApi(client); CostEstimateRequest costEstimateRequest = new CostEstimateRequest(); Amount amount = new Amount(); amount.setCurrency("EUR"); - amount.setValue(new Long("1000")); + amount.setValue(Long.valueOf("1000")); costEstimateRequest.setAmount(amount); CostEstimateAssumptions costEstimateAssumptions = new CostEstimateAssumptions(); @@ -143,12 +143,12 @@ public void TestGetCostEstimateInvalidMerchantMocked() throws Exception { @Test public void TestGetCostEstimateInvalidCardNumberMocked() throws Exception { Client client = createMockClientForErrors(422, "mocks/binlookup/getcostestimate-error-cardnumber.json"); - BinLookup binLookup = new BinLookup(client); + BinLookupApi binLookup = new BinLookupApi(client); CostEstimateRequest costEstimateRequest = new CostEstimateRequest(); Amount amount = new Amount(); amount.setCurrency("EUR"); - amount.setValue(new Long("1000")); + amount.setValue(Long.valueOf("1000")); costEstimateRequest.setAmount(amount); CostEstimateAssumptions costEstimateAssumptions = new CostEstimateAssumptions(); @@ -177,7 +177,7 @@ public void TestGetCostEstimateInvalidCardNumberMocked() throws Exception { @Test public void TestGetCostEstimateInvalidAmountMocked() throws Exception { Client client = createMockClientForErrors(422, "mocks/binlookup/getcostestimate-error-amount.json"); - BinLookup binLookup = new BinLookup(client); + BinLookupApi binLookup = new BinLookupApi(client); CostEstimateRequest costEstimateRequest = new CostEstimateRequest(); costEstimateRequest.setAmount(null); diff --git a/src/test/java/com/adyen/MarketPayTest.java b/src/test/java/com/adyen/MarketPayTest.java index e3ca5c9e9..115e0b06f 100644 --- a/src/test/java/com/adyen/MarketPayTest.java +++ b/src/test/java/com/adyen/MarketPayTest.java @@ -20,10 +20,10 @@ */ package com.adyen; -import com.adyen.model.payments.Card; -import com.adyen.model.payments.FraudCheckResult; -import com.adyen.model.payments.PaymentRequest; -import com.adyen.model.payments.PaymentResult; +import com.adyen.model.payment.Card; +import com.adyen.model.payment.FraudCheckResult; +import com.adyen.model.payment.PaymentRequest; +import com.adyen.model.payment.PaymentResult; import com.adyen.model.additionalData.SplitPayment; import com.adyen.model.additionalData.SplitPaymentItem; import com.adyen.model.hop.GetOnboardingUrlRequest; @@ -34,7 +34,7 @@ import com.adyen.service.Account; import com.adyen.service.Fund; import com.adyen.service.Hop; -import com.adyen.service.Payment; +import com.adyen.service.PaymentApi; import com.adyen.service.exception.ApiException; import com.adyen.util.DateUtil; import org.junit.Test; @@ -65,10 +65,10 @@ public class MarketPayTest extends BaseTest { @Test public void TestCreateSplitPayment() throws Exception { Client client = createMockClientFromFile("mocks/authorise-success.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); PaymentRequest paymentRequest = createBasePaymentRequest(new PaymentRequest()).reference("123456"); - paymentRequest.setAmount(new com.adyen.model.payments.Amount().value(6200L).currency("EUR")); + paymentRequest.setAmount(new com.adyen.model.payment.Amount().value(6200L).currency("EUR")); Card card = new Card(); card.setExpiryMonth("08"); card.setExpiryYear("2018"); @@ -104,7 +104,7 @@ public void TestCreateSplitPayment() throws Exception { // add items to list splitPayment.setSplitPaymentItems(splitPaymentItems); - // add it into the request + // add it into the requests setSplitPayment(paymentRequest, splitPayment); PaymentResult paymentResult = payment.authorise(paymentRequest); diff --git a/src/test/java/com/adyen/PaymentTest.java b/src/test/java/com/adyen/PaymentTest.java index 566ce2f67..4f08a4912 100644 --- a/src/test/java/com/adyen/PaymentTest.java +++ b/src/test/java/com/adyen/PaymentTest.java @@ -26,13 +26,12 @@ import com.adyen.httpclient.ClientInterface; import com.adyen.httpclient.HTTPClientException; import com.adyen.model.RequestOptions; -import com.adyen.model.payments.*; -import com.adyen.service.Payment; +import com.adyen.model.payment.*; +import com.adyen.service.PaymentApi; import com.adyen.service.exception.ApiException; import com.adyen.util.DateUtil; import com.google.gson.reflect.TypeToken; import okio.ByteString; -import org.junit.Ignore; import org.junit.Test; import java.io.IOException; @@ -47,7 +46,7 @@ import static com.adyen.constants.ApiConstants.AdditionalData.*; import static com.adyen.constants.ApiConstants.SelectedBrand.BOLETO_SANTANDER; -import static com.adyen.model.payments.PaymentResult.ResultCodeEnum.RECEIVED; +import static com.adyen.model.payment.PaymentResult.ResultCodeEnum.RECEIVED; import static org.junit.Assert.*; import static org.mockito.Mockito.*; @@ -61,7 +60,7 @@ public class PaymentTest extends BaseTest { @Test public void TestAuthoriseSuccessMocked() throws Exception { Client client = createMockClientFromFile("mocks/authorise-success.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); PaymentRequest paymentRequest = createFullCardPaymentRequest(); @@ -105,7 +104,7 @@ public void TestAuthoriseSuccessMocked() throws Exception { @Test public void TestAuthoriseError010Mocked() throws Exception { Client client = createMockClientForErrors(403, "mocks/authorise-error-010.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); PaymentRequest paymentRequest = createFullCardPaymentRequest(); @@ -124,7 +123,7 @@ public void TestAuthoriseError010Mocked() throws Exception { @Test public void TestAuthoriseErrorCVCDeclinedMocked() throws Exception { Client client = createMockClientFromFile("mocks/authorise-error-cvc-declined.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); PaymentRequest paymentRequest = createFullCardPaymentRequest(); @@ -139,7 +138,7 @@ public void TestAuthoriseErrorCVCDeclinedMocked() throws Exception { @Test public void TestAuthoriseSuccess3DMocked() throws Exception { Client client = createMockClientFromFile("mocks/authorise-success-3d.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); PaymentRequest paymentRequest = createFullCardPaymentRequest(); @@ -157,11 +156,11 @@ public void TestAuthoriseSuccess3DMocked() throws Exception { @Test public void TestAuthorise3DSuccessMocked() throws Exception { Client client = createMockClientFromFile("mocks/authorise3d-success.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); PaymentRequest3d paymentRequest3d = create3DPaymentRequest(); - PaymentResult paymentResult = payment.authorise3D(paymentRequest3d); + PaymentResult paymentResult = payment.authorise3d(paymentRequest3d); assertAuthorised(paymentResult); assertNotNull(paymentResult.getPspReference()); @@ -173,11 +172,11 @@ public void TestAuthorise3DSuccessMocked() throws Exception { @Test public void TestAuthorise3DS2SuccessMocked() throws Exception { Client client = createMockClientFromFile("mocks/authorise-success-3ds2.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); PaymentRequest3ds2 paymentRequest3ds2 = create3DS2PaymentRequest(); - PaymentResult paymentResult = payment.authorise3DS2(paymentRequest3ds2); + PaymentResult paymentResult = payment.authorise3ds2(paymentRequest3ds2); assertAuthorised(paymentResult); assertNotNull(paymentResult.getAdditionalData()); @@ -191,7 +190,7 @@ public void TestAuthorise3DS2SuccessMocked() throws Exception { @Test public void TestRetrieve3ds2ResultSuccessMocked() throws Exception { Client client = createMockClientFromFile("mocks/retrieve-result-success-3ds2.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); ThreeDS2ResultRequest threeDS2ResultRequest = new ThreeDS2ResultRequest(); threeDS2ResultRequest.setMerchantAccount("AMerchantAccount"); threeDS2ResultRequest.setPspReference("9935272408535455"); @@ -210,7 +209,7 @@ public void TestRetrieve3ds2ResultSuccessMocked() throws Exception { @Test public void TestAuthoriseCSESuccessMocked() throws Exception { Client client = createMockClientFromFile("mocks/authorise-success-cse.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); PaymentRequest paymentRequest = createCSEPaymentRequest(); @@ -225,7 +224,7 @@ public void TestAuthoriseCSESuccessMocked() throws Exception { @Test public void TestAuthoriseCSEErrorExpiredMocked() throws Exception { Client client = createMockClientFromFile("mocks/authorise-error-expired.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); PaymentRequest paymentRequest = createCSEPaymentRequest(); @@ -250,7 +249,7 @@ public void TestError401Mocked() throws Exception { Client client = new Client(); client.setHttpClient(adyenHttpClient); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); PaymentRequest paymentRequest = createFullCardPaymentRequest(); @@ -271,7 +270,7 @@ public void TestError401Mocked() throws Exception { public void TestOpenInvoice() throws Exception { Client client = createMockClientFromFile("mocks/authorise-success-klarna.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); PaymentRequest paymentRequest = this.createOpenInvoicePaymentRequest(); PaymentResult paymentResult = payment.authorise(paymentRequest); @@ -284,7 +283,7 @@ public void TestOpenInvoice() throws Exception { public void TestBoletoSuccess() throws Exception { Client client = createMockClientFromFile("mocks/authorise-success-boleto.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); Address billingAddress = new Address(); billingAddress.setCity("São Paulo"); @@ -330,7 +329,7 @@ public void TestBoletoSuccess() throws Exception { public void TestGetAuthenticationResult3ds1Success() throws IOException, ApiException { Client client = createMockClientFromFile("mocks/authentication-result-success-3ds1.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); AuthenticationResultRequest authenticationResultRequest = createAuthenticationResultRequest(); AuthenticationResultResponse authenticationResultResponse = payment.getAuthenticationResult(authenticationResultRequest); assertNotNull(authenticationResultResponse); @@ -342,7 +341,7 @@ public void TestGetAuthenticationResult3ds1Success() throws IOException, ApiExce public void TestGetAuthenticationResult3ds2Success() throws IOException, ApiException { Client client = createMockClientFromFile("mocks/authentication-result-success-3ds2.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); AuthenticationResultRequest authenticationResultRequest = createAuthenticationResultRequest(); AuthenticationResultResponse authenticationResultResponse = payment.getAuthenticationResult(authenticationResultRequest); assertNotNull(authenticationResultResponse); @@ -354,7 +353,7 @@ public void TestGetAuthenticationResult3ds2Success() throws IOException, ApiExce public void TestGetAuthenticationResultErrorOldAuthentication() throws IOException { Client client = createMockClientForErrors(422, "mocks/authentication-result-error-old-psp.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); AuthenticationResultRequest authenticationResultRequest = createAuthenticationResultRequest(); try { payment.getAuthenticationResult(authenticationResultRequest); @@ -370,7 +369,7 @@ public void TestGetAuthenticationResultErrorOldAuthentication() throws IOExcepti public void TestGetAuthenticationResultErrorNotFound() throws IOException { Client client = createMockClientForErrors(422, "mocks/authentication-result-error-not-found.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); AuthenticationResultRequest authenticationResultRequest = createAuthenticationResultRequest(); try { payment.getAuthenticationResult(authenticationResultRequest); @@ -386,7 +385,7 @@ public void TestGetAuthenticationResultErrorNotFound() throws IOException { public void TestGetAuthenticationResultErrorInvalidPsp() throws IOException { Client client = createMockClientForErrors(422, "mocks/authentication-result-error-invalid-psp.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); AuthenticationResultRequest authenticationResultRequest = createAuthenticationResultRequest(); authenticationResultRequest.setPspReference(null); try { @@ -404,7 +403,7 @@ public void TestGetAuthenticationResultErrorNotAllowed() throws IOException { Client client = createMockClientForErrors(403, "mocks/authentication-result-error-not-allowed.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); AuthenticationResultRequest authenticationResultRequest = createAuthenticationResultRequest(); try { payment.getAuthenticationResult(authenticationResultRequest); @@ -416,23 +415,10 @@ public void TestGetAuthenticationResultErrorNotAllowed() throws IOException { } } - @Test - public void TestAuthoriseDefaultApplicationInfo() throws Exception { - Client client = createMockClientFromFile("mocks/authorise-success-cse.json"); - Payment payment = new Payment(client); - - PaymentRequest paymentRequest = createCSEPaymentRequest(); - - PaymentResult paymentResult = payment.authorise(paymentRequest); - - assertAuthorised(paymentResult); - assertEquals(applicationInfo, paymentRequest.getApplicationInfo()); - } - @Test public void TestAuthoriseCustomApplicationInfo() throws Exception { Client client = createMockClientFromFile("mocks/authorise-success-cse.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); PaymentRequest paymentRequest = createCSEPaymentRequest(); ApplicationInfo applicationInfo = new ApplicationInfo(); @@ -457,7 +443,7 @@ protected void assertRefused(PaymentResult paymentResult) { public void TestByteArrayDeserialization() throws Exception { Client client = createMockClientFromFile("mocks/authorise-success.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); final String expectedBytesAsString = "Let's pretend/ this a jpg or something="; final byte[] expectedBytes = expectedBytesAsString.getBytes(StandardCharsets.UTF_8); @@ -476,7 +462,7 @@ public void TestByteArrayDeserialization() throws Exception { @Test public void TestByteArrayToJSONString() throws Exception { Client client = createMockClientFromFile("mocks/authorise-success.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); PaymentRequest paymentRequest = new PaymentRequest(); paymentRequest.mpiData(new ThreeDSecureData().cavv("AQIDBAUGBwgJCgsMDQ4PEBESExQ=".getBytes())); @@ -490,7 +476,7 @@ public void TestByteArrayToJSONString() throws Exception { @Test public void testRefund() throws Exception { Client client = createMockClientFromFile("mocks/modification-success.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); RefundRequest request = new RefundRequest(); ModificationResult result = payment.refund(request); assertEquals(result.getResponse(), ModificationResult.ResponseEnum.REFUND_RECEIVED_); @@ -499,7 +485,7 @@ public void testRefund() throws Exception { @Test public void testCapture() throws Exception { Client client = createMockClientFromFile("mocks/modification-success.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); CaptureRequest request = new CaptureRequest(); ModificationResult result = payment.capture(request); assertEquals(result.getResponse(), ModificationResult.ResponseEnum.REFUND_RECEIVED_); @@ -508,7 +494,7 @@ public void testCapture() throws Exception { @Test public void testCancel() throws Exception { Client client = createMockClientFromFile("mocks/modification-success.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); CancelRequest request = new CancelRequest(); ModificationResult result = payment.cancel(request); assertEquals(result.getResponse(), ModificationResult.ResponseEnum.REFUND_RECEIVED_); @@ -517,7 +503,7 @@ public void testCancel() throws Exception { @Test public void testCancelOrRefund() throws Exception { Client client = createMockClientFromFile("mocks/modification-success.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); CancelOrRefundRequest request = new CancelOrRefundRequest(); ModificationResult result = payment.cancelOrRefund(request); assertEquals(result.getResponse(), ModificationResult.ResponseEnum.REFUND_RECEIVED_); @@ -526,7 +512,7 @@ public void testCancelOrRefund() throws Exception { @Test public void testTechnicalCancel() throws Exception { Client client = createMockClientFromFile("mocks/modification-success.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); TechnicalCancelRequest request = new TechnicalCancelRequest(); ModificationResult result = payment.technicalCancel(request); assertEquals(result.getResponse(), ModificationResult.ResponseEnum.REFUND_RECEIVED_); @@ -535,7 +521,7 @@ public void testTechnicalCancel() throws Exception { @Test public void testAdjustAuthorisation() throws Exception { Client client = createMockClientFromFile("mocks/modification-success.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); AdjustAuthorisationRequest request = new AdjustAuthorisationRequest(); ModificationResult result = payment.adjustAuthorisation(request); assertEquals(result.getResponse(), ModificationResult.ResponseEnum.REFUND_RECEIVED_); @@ -544,7 +530,7 @@ public void testAdjustAuthorisation() throws Exception { @Test public void testDonate() throws Exception { Client client = createMockClientFromFile("mocks/modification-success.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); DonationRequest request = new DonationRequest(); ModificationResult result = payment.donate(request); assertEquals(result.getResponse(), ModificationResult.ResponseEnum.REFUND_RECEIVED_); @@ -553,7 +539,7 @@ public void testDonate() throws Exception { @Test public void testVoidPendingRefund() throws Exception { Client client = createMockClientFromFile("mocks/modification-success.json"); - Payment payment = new Payment(client); + PaymentApi payment = new PaymentApi(client); VoidPendingRefundRequest request = new VoidPendingRefundRequest(); ModificationResult result = payment.voidPendingRefund(request); assertEquals(result.getResponse(), ModificationResult.ResponseEnum.REFUND_RECEIVED_); diff --git a/src/test/java/com/adyen/PosTerminalManagementTest.java b/src/test/java/com/adyen/PosTerminalManagementTest.java index 0bde66a61..77df39e6a 100644 --- a/src/test/java/com/adyen/PosTerminalManagementTest.java +++ b/src/test/java/com/adyen/PosTerminalManagementTest.java @@ -22,7 +22,7 @@ package com.adyen; import com.adyen.model.posterminalmanagement.*; -import com.adyen.service.PosTerminalManagement; +import com.adyen.service.PosTerminalManagementApi; import org.junit.Test; import java.util.ArrayList; @@ -35,7 +35,7 @@ public class PosTerminalManagementTest extends BaseTest { @Test public void testAssignTerminalsSuccess() throws Exception { Client client = createMockClientFromFile("mocks/posterminalmanagement/assign-terminals-success.json"); - PosTerminalManagement posTerminalManagement = new PosTerminalManagement(client); + PosTerminalManagementApi posTerminalManagement = new PosTerminalManagementApi(client); AssignTerminalsRequest request = new AssignTerminalsRequest(); request.setCompanyAccount("companyAccount"); @@ -49,7 +49,7 @@ public void testAssignTerminalsSuccess() throws Exception { @Test public void testFindTerminalSuccess() throws Exception { Client client = createMockClientFromFile("mocks/posterminalmanagement/find-terminal-success.json"); - PosTerminalManagement posTerminalManagement = new PosTerminalManagement(client); + PosTerminalManagementApi posTerminalManagement = new PosTerminalManagementApi(client); FindTerminalRequest request = new FindTerminalRequest(); request.setTerminal("P400Plus-375039202"); @@ -57,7 +57,6 @@ public void testFindTerminalSuccess() throws Exception { assertEquals("DemoCompany", result.getCompanyAccount()); assertEquals("TestMerchant", result.getMerchantAccount()); - assertEquals(false, result.isMerchantInventory()); assertEquals("MyStore", result.getStore()); assertEquals("P400Plus-375039202", result.getTerminal()); } @@ -65,7 +64,7 @@ public void testFindTerminalSuccess() throws Exception { @Test public void testGetTerminalsUnderAccountSuccess() throws Exception { Client client = createMockClientFromFile("mocks/posterminalmanagement/get-terminals-under-account-success.json"); - PosTerminalManagement posTerminalManagement = new PosTerminalManagement(client); + PosTerminalManagementApi posTerminalManagement = new PosTerminalManagementApi(client); GetTerminalsUnderAccountRequest request = new GetTerminalsUnderAccountRequest(); request.setCompanyAccount("DemoCompany"); @@ -80,7 +79,7 @@ public void testGetTerminalsUnderAccountSuccess() throws Exception { @Test public void testGetStoresUnderAccountSuccess() throws Exception { Client client = createMockClientFromFile("mocks/posterminalmanagement/get-stores-under-account-success.json"); - PosTerminalManagement posTerminalManagement = new PosTerminalManagement(client); + PosTerminalManagementApi posTerminalManagement = new PosTerminalManagementApi(client); GetStoresUnderAccountRequest request = new GetStoresUnderAccountRequest(); request.setCompanyAccount("DemoCompany"); @@ -99,7 +98,7 @@ public void testGetStoresUnderAccountSuccess() throws Exception { @Test public void testGetTerminalDetailsSuccess() throws Exception { Client client = createMockClientFromFile("mocks/posterminalmanagement/get-terminal-details-success.json"); - PosTerminalManagement posTerminalManagement = new PosTerminalManagement(client); + PosTerminalManagementApi posTerminalManagement = new PosTerminalManagementApi(client); GetTerminalDetailsRequest request = new GetTerminalDetailsRequest(); request.setTerminal("P400Plus-375039202"); From 1e6bdd439df7d469ffec8df0ff83540837c8d8b9 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Wed, 10 May 2023 09:34:09 +0200 Subject: [PATCH 29/32] [ITT-498] Regenerated Balance Platform (#1018) * Regenerated Balance * suppress all checkstyles * fix --- checkstyle-suppressions.xml | 2 +- .../model/balanceplatform/AccountHolder.java | 4 +- .../balanceplatform/AccountHolderInfo.java | 4 +- .../model/balanceplatform/BalanceAccount.java | 4 +- .../balanceplatform/BalanceAccountBase.java | 4 +- .../balanceplatform/BalanceAccountInfo.java | 4 +- .../BalanceAccountUpdateRequest.java | 4 +- .../{Address2.java => DeliveryAddress.java} | 76 ++-- .../balanceplatform/DeliveryContact.java | 12 +- .../com/adyen/model/balanceplatform/JSON.java | 2 +- .../com/adyen/service/BalanceControlApi.java | 2 +- .../balanceplatform/AccountHolders.java | 48 --- .../balanceplatform/AccountHoldersApi.java | 174 ++++++++ .../balanceplatform/BalanceAccounts.java | 80 ---- .../balanceplatform/BalanceAccountsApi.java | 371 ++++++++++++++++++ .../BankAccountValidation.java | 24 -- .../BankAccountValidationApi.java | 60 +++ .../service/balanceplatform/General.java | 31 -- .../balanceplatform/GrantAccountsApi.java | 67 ++++ .../balanceplatform/GrantOffersApi.java | 100 +++++ .../PaymentInstrumentGroups.java | 37 -- .../PaymentInstrumentGroupsApi.java | 129 ++++++ .../balanceplatform/PaymentInstruments.java | 45 --- .../PaymentInstrumentsApi.java | 200 ++++++++++ .../service/balanceplatform/PlatformApi.java | 111 ++++++ .../balanceplatform/TransactionRules.java | 44 --- .../balanceplatform/TransactionRulesApi.java | 164 ++++++++ .../java/com/adyen/BalancePlatformTest.java | 157 ++++---- 28 files changed, 1514 insertions(+), 446 deletions(-) rename src/main/java/com/adyen/model/balanceplatform/{Address2.java => DeliveryAddress.java} (83%) delete mode 100644 src/main/java/com/adyen/service/balanceplatform/AccountHolders.java create mode 100644 src/main/java/com/adyen/service/balanceplatform/AccountHoldersApi.java delete mode 100644 src/main/java/com/adyen/service/balanceplatform/BalanceAccounts.java create mode 100644 src/main/java/com/adyen/service/balanceplatform/BalanceAccountsApi.java delete mode 100644 src/main/java/com/adyen/service/balanceplatform/BankAccountValidation.java create mode 100644 src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java delete mode 100644 src/main/java/com/adyen/service/balanceplatform/General.java create mode 100644 src/main/java/com/adyen/service/balanceplatform/GrantAccountsApi.java create mode 100644 src/main/java/com/adyen/service/balanceplatform/GrantOffersApi.java delete mode 100644 src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroups.java create mode 100644 src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroupsApi.java delete mode 100644 src/main/java/com/adyen/service/balanceplatform/PaymentInstruments.java create mode 100644 src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentsApi.java create mode 100644 src/main/java/com/adyen/service/balanceplatform/PlatformApi.java delete mode 100644 src/main/java/com/adyen/service/balanceplatform/TransactionRules.java create mode 100644 src/main/java/com/adyen/service/balanceplatform/TransactionRulesApi.java diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml index 995fa2466..0c39a6b59 100644 --- a/checkstyle-suppressions.xml +++ b/checkstyle-suppressions.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java index ca3ec233a..1863e9dbb 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java @@ -367,10 +367,10 @@ public AccountHolder timeZone(String timeZone) { } /** - * The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * @return timeZone **/ - @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") + @ApiModelProperty(value = "The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") public String getTimeZone() { return timeZone; diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java index ecf156fe6..560fa8da5 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java @@ -231,10 +231,10 @@ public AccountHolderInfo timeZone(String timeZone) { } /** - * The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * @return timeZone **/ - @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") + @ApiModelProperty(value = "The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") public String getTimeZone() { return timeZone; diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java index ce47f790c..7a4b545a3 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java @@ -306,10 +306,10 @@ public BalanceAccount timeZone(String timeZone) { } /** - * The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * @return timeZone **/ - @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") + @ApiModelProperty(value = "The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") public String getTimeZone() { return timeZone; diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java index 59c564e5c..372adf4ec 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java @@ -269,10 +269,10 @@ public BalanceAccountBase timeZone(String timeZone) { } /** - * The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * @return timeZone **/ - @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") + @ApiModelProperty(value = "The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") public String getTimeZone() { return timeZone; diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java index ecba5a984..bbe282b21 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java @@ -166,10 +166,10 @@ public BalanceAccountInfo timeZone(String timeZone) { } /** - * The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * @return timeZone **/ - @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") + @ApiModelProperty(value = "The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") public String getTimeZone() { return timeZone; diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java index 59372f8b0..d861c3cf2 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java @@ -243,10 +243,10 @@ public BalanceAccountUpdateRequest timeZone(String timeZone) { } /** - * The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). * @return timeZone **/ - @ApiModelProperty(value = "The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") + @ApiModelProperty(value = "The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") public String getTimeZone() { return timeZone; diff --git a/src/main/java/com/adyen/model/balanceplatform/Address2.java b/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java similarity index 83% rename from src/main/java/com/adyen/model/balanceplatform/Address2.java rename to src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java index 80260941d..1194f1bba 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Address2.java +++ b/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java @@ -44,10 +44,10 @@ import com.adyen.model.balanceplatform.JSON; /** - * Address2 + * DeliveryAddress */ -public class Address2 { +public class DeliveryAddress { public static final String SERIALIZED_NAME_CITY = "city"; @SerializedName(SERIALIZED_NAME_CITY) private String city; @@ -76,10 +76,10 @@ public class Address2 { @SerializedName(SERIALIZED_NAME_STATE_OR_PROVINCE) private String stateOrProvince; - public Address2() { + public DeliveryAddress() { } - public Address2 city(String city) { + public DeliveryAddress city(String city) { this.city = city; return this; @@ -101,7 +101,7 @@ public void setCity(String city) { } - public Address2 country(String country) { + public DeliveryAddress country(String country) { this.country = country; return this; @@ -123,7 +123,7 @@ public void setCountry(String country) { } - public Address2 line1(String line1) { + public DeliveryAddress line1(String line1) { this.line1 = line1; return this; @@ -145,7 +145,7 @@ public void setLine1(String line1) { } - public Address2 line2(String line2) { + public DeliveryAddress line2(String line2) { this.line2 = line2; return this; @@ -167,7 +167,7 @@ public void setLine2(String line2) { } - public Address2 line3(String line3) { + public DeliveryAddress line3(String line3) { this.line3 = line3; return this; @@ -189,7 +189,7 @@ public void setLine3(String line3) { } - public Address2 postalCode(String postalCode) { + public DeliveryAddress postalCode(String postalCode) { this.postalCode = postalCode; return this; @@ -211,7 +211,7 @@ public void setPostalCode(String postalCode) { } - public Address2 stateOrProvince(String stateOrProvince) { + public DeliveryAddress stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; return this; @@ -242,14 +242,14 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - Address2 address2 = (Address2) o; - return Objects.equals(this.city, address2.city) && - Objects.equals(this.country, address2.country) && - Objects.equals(this.line1, address2.line1) && - Objects.equals(this.line2, address2.line2) && - Objects.equals(this.line3, address2.line3) && - Objects.equals(this.postalCode, address2.postalCode) && - Objects.equals(this.stateOrProvince, address2.stateOrProvince); + DeliveryAddress deliveryAddress = (DeliveryAddress) o; + return Objects.equals(this.city, deliveryAddress.city) && + Objects.equals(this.country, deliveryAddress.country) && + Objects.equals(this.line1, deliveryAddress.line1) && + Objects.equals(this.line2, deliveryAddress.line2) && + Objects.equals(this.line3, deliveryAddress.line3) && + Objects.equals(this.postalCode, deliveryAddress.postalCode) && + Objects.equals(this.stateOrProvince, deliveryAddress.stateOrProvince); } @Override @@ -260,7 +260,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class Address2 {\n"); + sb.append("class DeliveryAddress {\n"); sb.append(" city: ").append(toIndentedString(city)).append("\n"); sb.append(" country: ").append(toIndentedString(country)).append("\n"); sb.append(" line1: ").append(toIndentedString(line1)).append("\n"); @@ -307,27 +307,27 @@ private String toIndentedString(Object o) { * Validates the JSON Object and throws an exception if issues found * * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to Address2 + * @throws IOException if the JSON Object is invalid with respect to DeliveryAddress */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { - if (Address2.openapiRequiredFields.isEmpty()) { + if (DeliveryAddress.openapiRequiredFields.isEmpty()) { return; } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in Address2 is not found in the empty JSON string", Address2.openapiRequiredFields.toString())); + throw new IllegalArgumentException(String.format("The required field(s) %s in DeliveryAddress is not found in the empty JSON string", DeliveryAddress.openapiRequiredFields.toString())); } } Set> entries = jsonObj.entrySet(); // check to see if the JSON string contains additional fields for (Entry entry : entries) { - if (!Address2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Address2` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + if (!DeliveryAddress.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeliveryAddress` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Address2.openapiRequiredFields) { + for (String requiredField : DeliveryAddress.openapiRequiredFields) { if (jsonObj.get(requiredField) == null) { throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); } @@ -366,22 +366,22 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!Address2.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'Address2' and its subtypes + if (!DeliveryAddress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeliveryAddress' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(Address2.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeliveryAddress.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, Address2 value) throws IOException { + public void write(JsonWriter out, DeliveryAddress value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public Address2 read(JsonReader in) throws IOException { + public DeliveryAddress read(JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); return thisAdapter.fromJsonTree(jsonObj); @@ -392,18 +392,18 @@ public Address2 read(JsonReader in) throws IOException { } /** - * Create an instance of Address2 given an JSON string + * Create an instance of DeliveryAddress given an JSON string * * @param jsonString JSON string - * @return An instance of Address2 - * @throws IOException if the JSON string is invalid with respect to Address2 + * @return An instance of DeliveryAddress + * @throws IOException if the JSON string is invalid with respect to DeliveryAddress */ - public static Address2 fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, Address2.class); + public static DeliveryAddress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeliveryAddress.class); } /** - * Convert an instance of Address2 to an JSON string + * Convert an instance of DeliveryAddress to an JSON string * * @return JSON string */ diff --git a/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java b/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java index 8b5ab13bd..ea55d0296 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java +++ b/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java @@ -14,7 +14,7 @@ import java.util.Objects; import java.util.Arrays; -import com.adyen.model.balanceplatform.Address2; +import com.adyen.model.balanceplatform.DeliveryAddress; import com.adyen.model.balanceplatform.Name; import com.adyen.model.balanceplatform.PhoneNumber; import com.google.gson.TypeAdapter; @@ -53,7 +53,7 @@ public class DeliveryContact { public static final String SERIALIZED_NAME_ADDRESS = "address"; @SerializedName(SERIALIZED_NAME_ADDRESS) - private Address2 address; + private DeliveryAddress address; public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) @@ -78,7 +78,7 @@ public class DeliveryContact { public DeliveryContact() { } - public DeliveryContact address(Address2 address) { + public DeliveryContact address(DeliveryAddress address) { this.address = address; return this; @@ -90,12 +90,12 @@ public DeliveryContact address(Address2 address) { **/ @ApiModelProperty(required = true, value = "") - public Address2 getAddress() { + public DeliveryAddress getAddress() { return address; } - public void setAddress(Address2 address) { + public void setAddress(DeliveryAddress address) { this.address = address; } @@ -309,7 +309,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field `address` if (jsonObj.getAsJsonObject("address") != null) { - Address2.validateJsonObject(jsonObj.getAsJsonObject("address")); + DeliveryAddress.validateJsonObject(jsonObj.getAsJsonObject("address")); } // validate the optional field email if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/balanceplatform/JSON.java b/src/main/java/com/adyen/model/balanceplatform/JSON.java index ffbb105be..4294800e7 100644 --- a/src/main/java/com/adyen/model/balanceplatform/JSON.java +++ b/src/main/java/com/adyen/model/balanceplatform/JSON.java @@ -100,7 +100,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.ActiveNetworkTokensRestriction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.AdditionalBankIdentification.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Address.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Address2.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Amount.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Authentication.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Balance.CustomTypeAdapterFactory()); @@ -125,6 +124,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.CountriesRestriction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.CronSweepSchedule.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.DayOfWeekRestriction.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.DeliveryAddress.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.DeliveryContact.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.DifferentCurrenciesRestriction.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.balanceplatform.Duration.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/adyen/service/BalanceControlApi.java b/src/main/java/com/adyen/service/BalanceControlApi.java index 4251425be..e1bf14206 100644 --- a/src/main/java/com/adyen/service/BalanceControlApi.java +++ b/src/main/java/com/adyen/service/BalanceControlApi.java @@ -1,6 +1,6 @@ /* * Adyen Balance Control API - * The Balance Control API lets you transfer funds between merchant accounts that belong to the same legal entity and are under the same company account. ## Authentication To connect to the Balance Control API, you must authenticate your requests with an [API key or basic auth username and password](https://docs.adyen.com/development-resources/api-authentication). To learn how you can generate these, see [API credentials](https://docs.adyen.com/development-resources/api-credentials).Here is an example of authenticating a request with an API key: ``` curl -H \"X-API-Key: Your_API_key\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate API credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning The Balance Control API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BalanceControl/v1/balanceTransfer ``` + * The Balance Control API lets you transfer funds between merchant accounts that belong to the same legal entity and are under the same company account. ## Authentication To connect to the Balance Control API, you must authenticate your requests with an [API key or basic auth username and password](https://docs.adyen.com/development-resources/api-authentication). To learn how you can generate these, see [API credentials](https://docs.adyen.com/development-resources/api-credentials).Here is an example of authenticating a request with an API key: ``` curl -H \"X-API-Key: Your_API_key\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate API credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning The Balance Control API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BalanceControl/v1/balanceTransfer ``` * * The version of the OpenAPI document: 1 * Contact: developer-experience@adyen.com diff --git a/src/main/java/com/adyen/service/balanceplatform/AccountHolders.java b/src/main/java/com/adyen/service/balanceplatform/AccountHolders.java deleted file mode 100644 index 7722f78a8..000000000 --- a/src/main/java/com/adyen/service/balanceplatform/AccountHolders.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.adyen.service.balanceplatform; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.constants.ApiConstants; -import com.adyen.model.balanceplatform.AccountHolder; -import com.adyen.model.balanceplatform.AccountHolderInfo; -import com.adyen.model.balanceplatform.PaginatedBalanceAccountsResponse; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.balanceplatform.BalancePlatformResource; - -import java.io.IOException; -import java.util.Map; - - -public class AccountHolders extends Service { - - public AccountHolders(Client client) { - super(client); - } - - public AccountHolder create(AccountHolderInfo request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - BalancePlatformResource resource = new BalancePlatformResource(this, "/accountHolders"); - String jsonResult = resource.request(jsonRequest); - return AccountHolder.fromJson(jsonResult); - - } - - public AccountHolder retrieve(String accountHolderId) throws IOException, ApiException { - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/accountHolders/%s", accountHolderId)); - String jsonResult = resource.request(null, ApiConstants.HttpMethod.GET); - return AccountHolder.fromJson(jsonResult); - } - - public AccountHolder update(String accountHolderId, AccountHolder request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/accountHolders/%s", accountHolderId)); - String jsonResult = resource.request(jsonRequest, ApiConstants.HttpMethod.PATCH); - return AccountHolder.fromJson(jsonResult); - } - - public PaginatedBalanceAccountsResponse list(String accountHolderId, Map queryString) throws IOException, ApiException { - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/accountHolders/%s/balanceAccounts", accountHolderId)); - String jsonResult = resource.request(null, null, ApiConstants.HttpMethod.GET, null, queryString); - return PaginatedBalanceAccountsResponse.fromJson(jsonResult); - } -} diff --git a/src/main/java/com/adyen/service/balanceplatform/AccountHoldersApi.java b/src/main/java/com/adyen/service/balanceplatform/AccountHoldersApi.java new file mode 100644 index 000000000..542afa15e --- /dev/null +++ b/src/main/java/com/adyen/service/balanceplatform/AccountHoldersApi.java @@ -0,0 +1,174 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.balanceplatform; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.balanceplatform.AccountHolder; +import com.adyen.model.balanceplatform.AccountHolderInfo; +import com.adyen.model.balanceplatform.PaginatedBalanceAccountsResponse; +import com.adyen.model.balanceplatform.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class AccountHoldersApi extends Service { + private final String baseURL; + + public AccountHoldersApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Get an account holder + * + * @param id {@link String } The unique identifier of the account holder. (required) + * @return {@link AccountHolder } + * @throws ApiException if fails to make API call + */ + public AccountHolder getAccountHolder(String id) throws ApiException, IOException { + return getAccountHolder(id, null); + } + + /** + * Get an account holder + * + * @param id {@link String } The unique identifier of the account holder. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AccountHolder } + * @throws ApiException if fails to make API call + */ + public AccountHolder getAccountHolder(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/accountHolders/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return AccountHolder.fromJson(jsonResult); + } + + /** + * Get all balance accounts of an account holder + * + * @param id {@link String } The unique identifier of the account holder. (required) + * @return {@link PaginatedBalanceAccountsResponse } + * @throws ApiException if fails to make API call + */ + public PaginatedBalanceAccountsResponse getAllBalanceAccountsOfAccountHolder(String id) throws ApiException, IOException { + return getAllBalanceAccountsOfAccountHolder(id, null, null, null); + } + + /** + * Get all balance accounts of an account holder + * + * @param id {@link String } The unique identifier of the account holder. (required) + * @param offset {@link Integer } Query: The number of items that you want to skip. (optional) + * @param limit {@link Integer } Query: The number of items returned per page, maximum 100 items. By default, the response returns 10 items per page. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaginatedBalanceAccountsResponse } + * @throws ApiException if fails to make API call + */ + public PaginatedBalanceAccountsResponse getAllBalanceAccountsOfAccountHolder(String id, Integer offset, Integer limit, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + //Add query params + Map queryParams = new HashMap<>(); + if (offset != null) { + queryParams.put("offset", offset.toString()); + } + if (limit != null) { + queryParams.put("limit", limit.toString()); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/accountHolders/{id}/balanceAccounts", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return PaginatedBalanceAccountsResponse.fromJson(jsonResult); + } + + /** + * Update an account holder + * + * @param id {@link String } The unique identifier of the account holder. (required) + * @param accountHolder {@link AccountHolder } (required) + * @return {@link AccountHolder } + * @throws ApiException if fails to make API call + */ + public AccountHolder updateAccountHolder(String id, AccountHolder accountHolder) throws ApiException, IOException { + return updateAccountHolder(id, accountHolder, null); + } + + /** + * Update an account holder + * + * @param id {@link String } The unique identifier of the account holder. (required) + * @param accountHolder {@link AccountHolder } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AccountHolder } + * @throws ApiException if fails to make API call + */ + public AccountHolder updateAccountHolder(String id, AccountHolder accountHolder, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = accountHolder.toJson(); + Resource resource = new Resource(this, this.baseURL + "/accountHolders/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return AccountHolder.fromJson(jsonResult); + } + + /** + * Create an account holder + * + * @param accountHolderInfo {@link AccountHolderInfo } (required) + * @return {@link AccountHolder } + * @throws ApiException if fails to make API call + */ + public AccountHolder createAccountHolder(AccountHolderInfo accountHolderInfo) throws ApiException, IOException { + return createAccountHolder(accountHolderInfo, null); + } + + /** + * Create an account holder + * + * @param accountHolderInfo {@link AccountHolderInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link AccountHolder } + * @throws ApiException if fails to make API call + */ + public AccountHolder createAccountHolder(AccountHolderInfo accountHolderInfo, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = accountHolderInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/accountHolders", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return AccountHolder.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/balanceplatform/BalanceAccounts.java b/src/main/java/com/adyen/service/balanceplatform/BalanceAccounts.java deleted file mode 100644 index 2c2358bc5..000000000 --- a/src/main/java/com/adyen/service/balanceplatform/BalanceAccounts.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.adyen.service.balanceplatform; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.constants.ApiConstants; -import com.adyen.model.balanceplatform.BalanceAccount; -import com.adyen.model.balanceplatform.BalanceAccountInfo; -import com.adyen.model.balanceplatform.BalanceAccountUpdateRequest; -import com.adyen.model.balanceplatform.BalanceSweepConfigurationsResponse; -import com.adyen.model.balanceplatform.SweepConfigurationV2; -import com.adyen.model.balanceplatform.PaginatedPaymentInstrumentsResponse; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.balanceplatform.BalancePlatformResource; - -import java.io.IOException; -import java.util.Map; - -public class BalanceAccounts extends Service { - - public BalanceAccounts(Client client) { - super(client); - } - - public BalanceAccount create(BalanceAccountInfo request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - BalancePlatformResource resource = new BalancePlatformResource(this, "/balanceAccounts"); - String jsonResult = resource.request(jsonRequest); - return BalanceAccount.fromJson(jsonResult); - } - - public BalanceSweepConfigurationsResponse listSweeps(String balanceAccountId, Map queryString) throws IOException, ApiException { - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/balanceAccounts/%s/sweeps", balanceAccountId)); - String jsonResult = resource.request(null, null, ApiConstants.HttpMethod.GET, null, queryString); - return BalanceSweepConfigurationsResponse.fromJson(jsonResult); - } - - public SweepConfigurationV2 createSweep(String balanceAccountId, SweepConfigurationV2 request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/balanceAccounts/%s/sweeps", balanceAccountId)); - String jsonResult = resource.request(jsonRequest, ApiConstants.HttpMethod.POST); - return SweepConfigurationV2.fromJson(jsonResult); - } - - public void deleteSweep(String balanceAccountId, String sweepId) throws IOException, ApiException { - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/balanceAccounts/%s/sweeps/%s", balanceAccountId, sweepId)); - resource.request(null, ApiConstants.HttpMethod.DELETE); - } - - public SweepConfigurationV2 retrieveSweep(String balanceAccountId, String sweepId) throws IOException, ApiException { - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/balanceAccounts/%s/sweeps/%s", balanceAccountId, sweepId)); - String jsonResult = resource.request(null, ApiConstants.HttpMethod.GET); - return SweepConfigurationV2.fromJson(jsonResult); - } - - public SweepConfigurationV2 updateSweep(String balanceAccountId, String sweepId, SweepConfigurationV2 request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/balanceAccounts/%s/sweeps/%s", balanceAccountId, sweepId)); - String jsonResult = resource.request(jsonRequest, ApiConstants.HttpMethod.PATCH); - return SweepConfigurationV2.fromJson(jsonResult); - } - - public BalanceAccount retrieve(String balanceAccountId) throws IOException, ApiException { - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/balanceAccounts/%s", balanceAccountId)); - String jsonResult = resource.request(null, ApiConstants.HttpMethod.GET); - return BalanceAccount.fromJson(jsonResult); - } - - public BalanceAccount update(String balanceAccountId, BalanceAccountUpdateRequest request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/balanceAccounts/%s", balanceAccountId)); - String jsonResult = resource.request(jsonRequest, ApiConstants.HttpMethod.PATCH); - return BalanceAccount.fromJson(jsonResult); - } - - public PaginatedPaymentInstrumentsResponse listPaymentInstruments(String balanceAccountId, Map queryString) throws IOException, ApiException { - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/balanceAccounts/%s/paymentInstruments", balanceAccountId)); - String jsonResult = resource.request(null, null, ApiConstants.HttpMethod.GET, null, queryString); - return PaginatedPaymentInstrumentsResponse.fromJson(jsonResult); - } -} diff --git a/src/main/java/com/adyen/service/balanceplatform/BalanceAccountsApi.java b/src/main/java/com/adyen/service/balanceplatform/BalanceAccountsApi.java new file mode 100644 index 000000000..ae9d7b967 --- /dev/null +++ b/src/main/java/com/adyen/service/balanceplatform/BalanceAccountsApi.java @@ -0,0 +1,371 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.balanceplatform; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.balanceplatform.BalanceAccount; +import com.adyen.model.balanceplatform.BalanceAccountInfo; +import com.adyen.model.balanceplatform.BalanceAccountUpdateRequest; +import com.adyen.model.balanceplatform.BalanceSweepConfigurationsResponse; +import com.adyen.model.balanceplatform.PaginatedPaymentInstrumentsResponse; +import com.adyen.model.balanceplatform.RestServiceError; +import com.adyen.model.balanceplatform.SweepConfigurationV2; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class BalanceAccountsApi extends Service { + private final String baseURL; + + public BalanceAccountsApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Delete a sweep + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. (required) + * @param sweepId {@link String } The unique identifier of the sweep. (required) + * @throws ApiException if fails to make API call + */ + public void deleteSweep(String balanceAccountId, String sweepId) throws ApiException, IOException { + deleteSweep(balanceAccountId, sweepId, null); + } + + /** + * Delete a sweep + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. (required) + * @param sweepId {@link String } The unique identifier of the sweep. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @throws ApiException if fails to make API call + */ + public void deleteSweep(String balanceAccountId, String sweepId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (balanceAccountId == null) { + throw new IllegalArgumentException("Please provide the balanceAccountId path parameter"); + } + pathParams.put("balanceAccountId", balanceAccountId); + if (sweepId == null) { + throw new IllegalArgumentException("Please provide the sweepId path parameter"); + } + pathParams.put("sweepId", sweepId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}", null); + resource.request(requestBody, null, ApiConstants.HttpMethod.DELETE, pathParams); + } + + /** + * Get all sweeps for a balance account + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. (required) + * @return {@link BalanceSweepConfigurationsResponse } + * @throws ApiException if fails to make API call + */ + public BalanceSweepConfigurationsResponse getAllSweepsForBalanceAccount(String balanceAccountId) throws ApiException, IOException { + return getAllSweepsForBalanceAccount(balanceAccountId, null, null, null); + } + + /** + * Get all sweeps for a balance account + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. (required) + * @param offset {@link Integer } Query: The number of items that you want to skip. (optional) + * @param limit {@link Integer } Query: The number of items returned per page, maximum 100 items. By default, the response returns 10 items per page. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link BalanceSweepConfigurationsResponse } + * @throws ApiException if fails to make API call + */ + public BalanceSweepConfigurationsResponse getAllSweepsForBalanceAccount(String balanceAccountId, Integer offset, Integer limit, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (balanceAccountId == null) { + throw new IllegalArgumentException("Please provide the balanceAccountId path parameter"); + } + pathParams.put("balanceAccountId", balanceAccountId); + //Add query params + Map queryParams = new HashMap<>(); + if (offset != null) { + queryParams.put("offset", offset.toString()); + } + if (limit != null) { + queryParams.put("limit", limit.toString()); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/balanceAccounts/{balanceAccountId}/sweeps", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return BalanceSweepConfigurationsResponse.fromJson(jsonResult); + } + + /** + * Get a sweep + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. (required) + * @param sweepId {@link String } The unique identifier of the sweep. (required) + * @return {@link SweepConfigurationV2 } + * @throws ApiException if fails to make API call + */ + public SweepConfigurationV2 getSweep(String balanceAccountId, String sweepId) throws ApiException, IOException { + return getSweep(balanceAccountId, sweepId, null); + } + + /** + * Get a sweep + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. (required) + * @param sweepId {@link String } The unique identifier of the sweep. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link SweepConfigurationV2 } + * @throws ApiException if fails to make API call + */ + public SweepConfigurationV2 getSweep(String balanceAccountId, String sweepId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (balanceAccountId == null) { + throw new IllegalArgumentException("Please provide the balanceAccountId path parameter"); + } + pathParams.put("balanceAccountId", balanceAccountId); + if (sweepId == null) { + throw new IllegalArgumentException("Please provide the sweepId path parameter"); + } + pathParams.put("sweepId", sweepId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return SweepConfigurationV2.fromJson(jsonResult); + } + + /** + * Get a balance account + * + * @param id {@link String } The unique identifier of the balance account. (required) + * @return {@link BalanceAccount } + * @throws ApiException if fails to make API call + */ + public BalanceAccount getBalanceAccount(String id) throws ApiException, IOException { + return getBalanceAccount(id, null); + } + + /** + * Get a balance account + * + * @param id {@link String } The unique identifier of the balance account. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link BalanceAccount } + * @throws ApiException if fails to make API call + */ + public BalanceAccount getBalanceAccount(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/balanceAccounts/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return BalanceAccount.fromJson(jsonResult); + } + + /** + * Get all payment instruments for a balance account + * + * @param id {@link String } The unique identifier of the balance account. (required) + * @return {@link PaginatedPaymentInstrumentsResponse } + * @throws ApiException if fails to make API call + */ + public PaginatedPaymentInstrumentsResponse getAllPaymentInstrumentsForBalanceAccount(String id) throws ApiException, IOException { + return getAllPaymentInstrumentsForBalanceAccount(id, null, null, null); + } + + /** + * Get all payment instruments for a balance account + * + * @param id {@link String } The unique identifier of the balance account. (required) + * @param offset {@link Integer } Query: The number of items that you want to skip. (optional) + * @param limit {@link Integer } Query: The number of items returned per page, maximum 100 items. By default, the response returns 10 items per page. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaginatedPaymentInstrumentsResponse } + * @throws ApiException if fails to make API call + */ + public PaginatedPaymentInstrumentsResponse getAllPaymentInstrumentsForBalanceAccount(String id, Integer offset, Integer limit, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + //Add query params + Map queryParams = new HashMap<>(); + if (offset != null) { + queryParams.put("offset", offset.toString()); + } + if (limit != null) { + queryParams.put("limit", limit.toString()); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/balanceAccounts/{id}/paymentInstruments", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return PaginatedPaymentInstrumentsResponse.fromJson(jsonResult); + } + + /** + * Update a sweep + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. (required) + * @param sweepId {@link String } The unique identifier of the sweep. (required) + * @param sweepConfigurationV2 {@link SweepConfigurationV2 } (required) + * @return {@link SweepConfigurationV2 } + * @throws ApiException if fails to make API call + */ + public SweepConfigurationV2 updateSweep(String balanceAccountId, String sweepId, SweepConfigurationV2 sweepConfigurationV2) throws ApiException, IOException { + return updateSweep(balanceAccountId, sweepId, sweepConfigurationV2, null); + } + + /** + * Update a sweep + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. (required) + * @param sweepId {@link String } The unique identifier of the sweep. (required) + * @param sweepConfigurationV2 {@link SweepConfigurationV2 } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link SweepConfigurationV2 } + * @throws ApiException if fails to make API call + */ + public SweepConfigurationV2 updateSweep(String balanceAccountId, String sweepId, SweepConfigurationV2 sweepConfigurationV2, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (balanceAccountId == null) { + throw new IllegalArgumentException("Please provide the balanceAccountId path parameter"); + } + pathParams.put("balanceAccountId", balanceAccountId); + if (sweepId == null) { + throw new IllegalArgumentException("Please provide the sweepId path parameter"); + } + pathParams.put("sweepId", sweepId); + + String requestBody = sweepConfigurationV2.toJson(); + Resource resource = new Resource(this, this.baseURL + "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return SweepConfigurationV2.fromJson(jsonResult); + } + + /** + * Update a balance account + * + * @param id {@link String } The unique identifier of the balance account. (required) + * @param balanceAccountUpdateRequest {@link BalanceAccountUpdateRequest } (required) + * @return {@link BalanceAccount } + * @throws ApiException if fails to make API call + */ + public BalanceAccount updateBalanceAccount(String id, BalanceAccountUpdateRequest balanceAccountUpdateRequest) throws ApiException, IOException { + return updateBalanceAccount(id, balanceAccountUpdateRequest, null); + } + + /** + * Update a balance account + * + * @param id {@link String } The unique identifier of the balance account. (required) + * @param balanceAccountUpdateRequest {@link BalanceAccountUpdateRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link BalanceAccount } + * @throws ApiException if fails to make API call + */ + public BalanceAccount updateBalanceAccount(String id, BalanceAccountUpdateRequest balanceAccountUpdateRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = balanceAccountUpdateRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/balanceAccounts/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return BalanceAccount.fromJson(jsonResult); + } + + /** + * Create a balance account + * + * @param balanceAccountInfo {@link BalanceAccountInfo } (required) + * @return {@link BalanceAccount } + * @throws ApiException if fails to make API call + */ + public BalanceAccount createBalanceAccount(BalanceAccountInfo balanceAccountInfo) throws ApiException, IOException { + return createBalanceAccount(balanceAccountInfo, null); + } + + /** + * Create a balance account + * + * @param balanceAccountInfo {@link BalanceAccountInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link BalanceAccount } + * @throws ApiException if fails to make API call + */ + public BalanceAccount createBalanceAccount(BalanceAccountInfo balanceAccountInfo, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = balanceAccountInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/balanceAccounts", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return BalanceAccount.fromJson(jsonResult); + } + + /** + * Create a sweep + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. (required) + * @param sweepConfigurationV2 {@link SweepConfigurationV2 } (required) + * @return {@link SweepConfigurationV2 } + * @throws ApiException if fails to make API call + */ + public SweepConfigurationV2 createSweep(String balanceAccountId, SweepConfigurationV2 sweepConfigurationV2) throws ApiException, IOException { + return createSweep(balanceAccountId, sweepConfigurationV2, null); + } + + /** + * Create a sweep + * + * @param balanceAccountId {@link String } The unique identifier of the balance account. (required) + * @param sweepConfigurationV2 {@link SweepConfigurationV2 } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link SweepConfigurationV2 } + * @throws ApiException if fails to make API call + */ + public SweepConfigurationV2 createSweep(String balanceAccountId, SweepConfigurationV2 sweepConfigurationV2, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (balanceAccountId == null) { + throw new IllegalArgumentException("Please provide the balanceAccountId path parameter"); + } + pathParams.put("balanceAccountId", balanceAccountId); + + String requestBody = sweepConfigurationV2.toJson(); + Resource resource = new Resource(this, this.baseURL + "/balanceAccounts/{balanceAccountId}/sweeps", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, pathParams); + return SweepConfigurationV2.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/balanceplatform/BankAccountValidation.java b/src/main/java/com/adyen/service/balanceplatform/BankAccountValidation.java deleted file mode 100644 index 80a7f0814..000000000 --- a/src/main/java/com/adyen/service/balanceplatform/BankAccountValidation.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.adyen.service.balanceplatform; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.model.balanceplatform.JSON; -import com.adyen.model.balanceplatform.BankAccountIdentificationValidationRequest; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.balanceplatform.BalancePlatformResource; - -import java.io.IOException; - -public class BankAccountValidation extends Service { - - public BankAccountValidation(Client client) { - super(client); - new JSON(); - } - - public void validateBankAccountIdentification(BankAccountIdentificationValidationRequest bankAccountIdentificationValidationRequest) throws IOException, ApiException { - String jsonRequest = bankAccountIdentificationValidationRequest.toJson(); - BalancePlatformResource resource = new BalancePlatformResource(this, "/validateBankAccountIdentification"); - resource.request(jsonRequest); - } -} diff --git a/src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java b/src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java new file mode 100644 index 000000000..24213775e --- /dev/null +++ b/src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java @@ -0,0 +1,60 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.balanceplatform; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.balanceplatform.BankAccountIdentificationValidationRequest; +import com.adyen.model.balanceplatform.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class BankAccountValidationApi extends Service { + private final String baseURL; + + public BankAccountValidationApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Validate a bank account + * + * @param bankAccountIdentificationValidationRequest {@link BankAccountIdentificationValidationRequest } (required) + * @return void + * @throws ApiException if fails to make API call + */ + public void validateBankAccountIdentification(BankAccountIdentificationValidationRequest bankAccountIdentificationValidationRequest) throws ApiException, IOException { + validateBankAccountIdentification(bankAccountIdentificationValidationRequest, null); + } + + /** + * Validate a bank account + * + * @param bankAccountIdentificationValidationRequest {@link BankAccountIdentificationValidationRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return void + * @throws ApiException if fails to make API call + */ + public void validateBankAccountIdentification(BankAccountIdentificationValidationRequest bankAccountIdentificationValidationRequest, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = bankAccountIdentificationValidationRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/validateBankAccountIdentification", null); + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + } +} diff --git a/src/main/java/com/adyen/service/balanceplatform/General.java b/src/main/java/com/adyen/service/balanceplatform/General.java deleted file mode 100644 index 6de0840b8..000000000 --- a/src/main/java/com/adyen/service/balanceplatform/General.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.adyen.service.balanceplatform; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.constants.ApiConstants; -import com.adyen.model.balanceplatform.BalancePlatform; -import com.adyen.model.balanceplatform.PaginatedAccountHoldersResponse; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.balanceplatform.BalancePlatformResource; - -import java.io.IOException; -import java.util.Map; - -public class General extends Service { - - public General(Client client) { - super(client); - } - - public BalancePlatform retrieve(String platformId) throws IOException, ApiException { - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/balancePlatforms/%s", platformId)); - String jsonResult = resource.request(null, null, ApiConstants.HttpMethod.GET, null); - return BalancePlatform.fromJson(jsonResult); - } - - public PaginatedAccountHoldersResponse listAccountHolders(String platformId, Map queryString) throws IOException, ApiException { - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/balancePlatforms/%s/accountHolders", platformId)); - String jsonResult = resource.request(null, null, ApiConstants.HttpMethod.GET, null, queryString); - return PaginatedAccountHoldersResponse.fromJson(jsonResult); - } -} diff --git a/src/main/java/com/adyen/service/balanceplatform/GrantAccountsApi.java b/src/main/java/com/adyen/service/balanceplatform/GrantAccountsApi.java new file mode 100644 index 000000000..415232406 --- /dev/null +++ b/src/main/java/com/adyen/service/balanceplatform/GrantAccountsApi.java @@ -0,0 +1,67 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.balanceplatform; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.balanceplatform.CapitalGrantAccount; +import com.adyen.model.balanceplatform.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class GrantAccountsApi extends Service { + private final String baseURL; + + public GrantAccountsApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Get a grant account + * + * @param id {@link String } The unique identifier of the grant account. (required) + * @return {@link CapitalGrantAccount } + * @throws ApiException if fails to make API call + */ + public CapitalGrantAccount getGrantAccount(String id) throws ApiException, IOException { + return getGrantAccount(id, null); + } + + /** + * Get a grant account + * + * @param id {@link String } The unique identifier of the grant account. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CapitalGrantAccount } + * @throws ApiException if fails to make API call + */ + public CapitalGrantAccount getGrantAccount(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/grantAccounts/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return CapitalGrantAccount.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/balanceplatform/GrantOffersApi.java b/src/main/java/com/adyen/service/balanceplatform/GrantOffersApi.java new file mode 100644 index 000000000..043ccd706 --- /dev/null +++ b/src/main/java/com/adyen/service/balanceplatform/GrantOffersApi.java @@ -0,0 +1,100 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.balanceplatform; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.balanceplatform.GrantOffer; +import com.adyen.model.balanceplatform.GrantOffers; +import com.adyen.model.balanceplatform.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class GrantOffersApi extends Service { + private final String baseURL; + + public GrantOffersApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Get all available grant offers + * + * @param accountHolderId {@link String } The unique identifier of the grant account. (required) + * @return {@link GrantOffers } + * @throws ApiException if fails to make API call + */ + public GrantOffers getAllAvailableGrantOffers(String accountHolderId) throws ApiException, IOException { + return getAllAvailableGrantOffers(accountHolderId, null); + } + + /** + * Get all available grant offers + * + * @param accountHolderId {@link String } Query: The unique identifier of the grant account. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GrantOffers } + * @throws ApiException if fails to make API call + */ + public GrantOffers getAllAvailableGrantOffers(String accountHolderId, RequestOptions requestOptions) throws ApiException, IOException { + //Add query params + Map queryParams = new HashMap<>(); + if (accountHolderId != null) { + queryParams.put("accountHolderId", accountHolderId); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/grantOffers", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, null, queryParams); + return GrantOffers.fromJson(jsonResult); + } + + /** + * Get a grant offer + * + * @param grantOfferId {@link String } The unique identifier of the grant offer. (required) + * @return {@link GrantOffer } + * @throws ApiException if fails to make API call + */ + public GrantOffer getGrantOffer(String grantOfferId) throws ApiException, IOException { + return getGrantOffer(grantOfferId, null); + } + + /** + * Get a grant offer + * + * @param grantOfferId {@link String } The unique identifier of the grant offer. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link GrantOffer } + * @throws ApiException if fails to make API call + */ + public GrantOffer getGrantOffer(String grantOfferId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (grantOfferId == null) { + throw new IllegalArgumentException("Please provide the grantOfferId path parameter"); + } + pathParams.put("grantOfferId", grantOfferId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/grantOffers/{grantOfferId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return GrantOffer.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroups.java b/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroups.java deleted file mode 100644 index 2872193cf..000000000 --- a/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroups.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.adyen.service.balanceplatform; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.constants.ApiConstants; -import com.adyen.model.balanceplatform.PaymentInstrumentGroup; -import com.adyen.model.balanceplatform.PaymentInstrumentGroupInfo; -import com.adyen.model.balanceplatform.TransactionRulesResponse; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.balanceplatform.BalancePlatformResource; - -import java.io.IOException; - -public class PaymentInstrumentGroups extends Service { - public PaymentInstrumentGroups(Client client) { - super(client); - } - - public PaymentInstrumentGroup create(PaymentInstrumentGroupInfo request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - BalancePlatformResource resource = new BalancePlatformResource(this, "/paymentInstrumentsGroups"); - String jsonResult = resource.request(jsonRequest); - return PaymentInstrumentGroup.fromJson(jsonResult); - } - - public PaymentInstrumentGroup retrieve(String instrumentGroupId) throws IOException, ApiException { - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/paymentInstrumentsGroups/%s", instrumentGroupId)); - String jsonResult = resource.request(null, ApiConstants.HttpMethod.GET); - return PaymentInstrumentGroup.fromJson(jsonResult); - } - - public TransactionRulesResponse listTransactionRules(String instrumentGroupId) throws IOException, ApiException { - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/paymentInstrumentsGroups/%s/transactionRules", instrumentGroupId)); - String jsonResult = resource.request(null, ApiConstants.HttpMethod.GET); - return TransactionRulesResponse.fromJson(jsonResult); - } -} diff --git a/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroupsApi.java b/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroupsApi.java new file mode 100644 index 000000000..eba49c8d8 --- /dev/null +++ b/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentGroupsApi.java @@ -0,0 +1,129 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.balanceplatform; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.balanceplatform.PaymentInstrumentGroup; +import com.adyen.model.balanceplatform.PaymentInstrumentGroupInfo; +import com.adyen.model.balanceplatform.RestServiceError; +import com.adyen.model.balanceplatform.TransactionRulesResponse; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class PaymentInstrumentGroupsApi extends Service { + private final String baseURL; + + public PaymentInstrumentGroupsApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Get a payment instrument group + * + * @param id {@link String } The unique identifier of the payment instrument group. (required) + * @return {@link PaymentInstrumentGroup } + * @throws ApiException if fails to make API call + */ + public PaymentInstrumentGroup getPaymentInstrumentGroup(String id) throws ApiException, IOException { + return getPaymentInstrumentGroup(id, null); + } + + /** + * Get a payment instrument group + * + * @param id {@link String } The unique identifier of the payment instrument group. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentInstrumentGroup } + * @throws ApiException if fails to make API call + */ + public PaymentInstrumentGroup getPaymentInstrumentGroup(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/paymentInstrumentGroups/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return PaymentInstrumentGroup.fromJson(jsonResult); + } + + /** + * Get all transaction rules for a payment instrument group + * + * @param id {@link String } The unique identifier of the payment instrument group. (required) + * @return {@link TransactionRulesResponse } + * @throws ApiException if fails to make API call + */ + public TransactionRulesResponse getAllTransactionRulesForPaymentInstrumentGroup(String id) throws ApiException, IOException { + return getAllTransactionRulesForPaymentInstrumentGroup(id, null); + } + + /** + * Get all transaction rules for a payment instrument group + * + * @param id {@link String } The unique identifier of the payment instrument group. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TransactionRulesResponse } + * @throws ApiException if fails to make API call + */ + public TransactionRulesResponse getAllTransactionRulesForPaymentInstrumentGroup(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/paymentInstrumentGroups/{id}/transactionRules", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return TransactionRulesResponse.fromJson(jsonResult); + } + + /** + * Create a payment instrument group + * + * @param paymentInstrumentGroupInfo {@link PaymentInstrumentGroupInfo } (required) + * @return {@link PaymentInstrumentGroup } + * @throws ApiException if fails to make API call + */ + public PaymentInstrumentGroup createPaymentInstrumentGroup(PaymentInstrumentGroupInfo paymentInstrumentGroupInfo) throws ApiException, IOException { + return createPaymentInstrumentGroup(paymentInstrumentGroupInfo, null); + } + + /** + * Create a payment instrument group + * + * @param paymentInstrumentGroupInfo {@link PaymentInstrumentGroupInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentInstrumentGroup } + * @throws ApiException if fails to make API call + */ + public PaymentInstrumentGroup createPaymentInstrumentGroup(PaymentInstrumentGroupInfo paymentInstrumentGroupInfo, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = paymentInstrumentGroupInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/paymentInstrumentGroups", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return PaymentInstrumentGroup.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/balanceplatform/PaymentInstruments.java b/src/main/java/com/adyen/service/balanceplatform/PaymentInstruments.java deleted file mode 100644 index 3715f8ebd..000000000 --- a/src/main/java/com/adyen/service/balanceplatform/PaymentInstruments.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.adyen.service.balanceplatform; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.constants.ApiConstants; -import com.adyen.model.balanceplatform.PaymentInstrument; -import com.adyen.model.balanceplatform.PaymentInstrumentInfo; -import com.adyen.model.balanceplatform.PaymentInstrumentUpdateRequest; -import com.adyen.model.balanceplatform.TransactionRulesResponse; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.balanceplatform.BalancePlatformResource; - -import java.io.IOException; - -public class PaymentInstruments extends Service { - public PaymentInstruments(Client client) { - super(client); - } - - public PaymentInstrument create(PaymentInstrumentInfo request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - BalancePlatformResource resource = new BalancePlatformResource(this, "/paymentInstruments"); - String jsonResult = resource.request(jsonRequest); - return PaymentInstrument.fromJson(jsonResult); - } - - public PaymentInstrument retrieve(String paymentInstrumentId) throws IOException, ApiException { - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/paymentInstruments/%s", paymentInstrumentId)); - String jsonResult = resource.request(null, ApiConstants.HttpMethod.GET); - return PaymentInstrument.fromJson(jsonResult); - } - - public PaymentInstrument update(String paymentInstrumentId, PaymentInstrumentUpdateRequest request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/paymentInstruments/%s", paymentInstrumentId)); - String jsonResult = resource.request(jsonRequest, ApiConstants.HttpMethod.PATCH); - return PaymentInstrument.fromJson(jsonResult); - } - - public TransactionRulesResponse listTransactionRules(String paymentInstrumentId) throws IOException, ApiException { - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/paymentInstruments/%s/transactionRules", paymentInstrumentId)); - String jsonResult = resource.request(null, ApiConstants.HttpMethod.GET); - return TransactionRulesResponse.fromJson(jsonResult); - } -} diff --git a/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentsApi.java b/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentsApi.java new file mode 100644 index 000000000..b4aa6f93e --- /dev/null +++ b/src/main/java/com/adyen/service/balanceplatform/PaymentInstrumentsApi.java @@ -0,0 +1,200 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.balanceplatform; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.balanceplatform.PaymentInstrument; +import com.adyen.model.balanceplatform.PaymentInstrumentInfo; +import com.adyen.model.balanceplatform.PaymentInstrumentRevealInfo; +import com.adyen.model.balanceplatform.PaymentInstrumentUpdateRequest; +import com.adyen.model.balanceplatform.RestServiceError; +import com.adyen.model.balanceplatform.TransactionRulesResponse; +import com.adyen.model.balanceplatform.UpdatePaymentInstrument; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class PaymentInstrumentsApi extends Service { + private final String baseURL; + + public PaymentInstrumentsApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Get a payment instrument + * + * @param id {@link String } The unique identifier of the payment instrument. (required) + * @return {@link PaymentInstrument } + * @throws ApiException if fails to make API call + */ + public PaymentInstrument getPaymentInstrument(String id) throws ApiException, IOException { + return getPaymentInstrument(id, null); + } + + /** + * Get a payment instrument + * + * @param id {@link String } The unique identifier of the payment instrument. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentInstrument } + * @throws ApiException if fails to make API call + */ + public PaymentInstrument getPaymentInstrument(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/paymentInstruments/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return PaymentInstrument.fromJson(jsonResult); + } + + /** + * Get the PAN of a payment instrument + * + * @param id {@link String } The unique identifier of the payment instrument. (required) + * @return {@link PaymentInstrumentRevealInfo } + * @throws ApiException if fails to make API call + */ + public PaymentInstrumentRevealInfo getPanOfPaymentInstrument(String id) throws ApiException, IOException { + return getPanOfPaymentInstrument(id, null); + } + + /** + * Get the PAN of a payment instrument + * + * @param id {@link String } The unique identifier of the payment instrument. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentInstrumentRevealInfo } + * @throws ApiException if fails to make API call + */ + public PaymentInstrumentRevealInfo getPanOfPaymentInstrument(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/paymentInstruments/{id}/reveal", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return PaymentInstrumentRevealInfo.fromJson(jsonResult); + } + + /** + * Get all transaction rules for a payment instrument + * + * @param id {@link String } The unique identifier of the payment instrument. (required) + * @return {@link TransactionRulesResponse } + * @throws ApiException if fails to make API call + */ + public TransactionRulesResponse getAllTransactionRulesForPaymentInstrument(String id) throws ApiException, IOException { + return getAllTransactionRulesForPaymentInstrument(id, null); + } + + /** + * Get all transaction rules for a payment instrument + * + * @param id {@link String } The unique identifier of the payment instrument. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TransactionRulesResponse } + * @throws ApiException if fails to make API call + */ + public TransactionRulesResponse getAllTransactionRulesForPaymentInstrument(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/paymentInstruments/{id}/transactionRules", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return TransactionRulesResponse.fromJson(jsonResult); + } + + /** + * Update a payment instrument + * + * @param id {@link String } The unique identifier of the payment instrument. (required) + * @param paymentInstrumentUpdateRequest {@link PaymentInstrumentUpdateRequest } (required) + * @return {@link UpdatePaymentInstrument } + * @throws ApiException if fails to make API call + */ + public UpdatePaymentInstrument updatePaymentInstrument(String id, PaymentInstrumentUpdateRequest paymentInstrumentUpdateRequest) throws ApiException, IOException { + return updatePaymentInstrument(id, paymentInstrumentUpdateRequest, null); + } + + /** + * Update a payment instrument + * + * @param id {@link String } The unique identifier of the payment instrument. (required) + * @param paymentInstrumentUpdateRequest {@link PaymentInstrumentUpdateRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link UpdatePaymentInstrument } + * @throws ApiException if fails to make API call + */ + public UpdatePaymentInstrument updatePaymentInstrument(String id, PaymentInstrumentUpdateRequest paymentInstrumentUpdateRequest, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = paymentInstrumentUpdateRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/paymentInstruments/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return UpdatePaymentInstrument.fromJson(jsonResult); + } + + /** + * Create a payment instrument + * + * @param paymentInstrumentInfo {@link PaymentInstrumentInfo } (required) + * @return {@link PaymentInstrument } + * @throws ApiException if fails to make API call + */ + public PaymentInstrument createPaymentInstrument(PaymentInstrumentInfo paymentInstrumentInfo) throws ApiException, IOException { + return createPaymentInstrument(paymentInstrumentInfo, null); + } + + /** + * Create a payment instrument + * + * @param paymentInstrumentInfo {@link PaymentInstrumentInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaymentInstrument } + * @throws ApiException if fails to make API call + */ + public PaymentInstrument createPaymentInstrument(PaymentInstrumentInfo paymentInstrumentInfo, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = paymentInstrumentInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/paymentInstruments", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return PaymentInstrument.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/balanceplatform/PlatformApi.java b/src/main/java/com/adyen/service/balanceplatform/PlatformApi.java new file mode 100644 index 000000000..1a90a1dd2 --- /dev/null +++ b/src/main/java/com/adyen/service/balanceplatform/PlatformApi.java @@ -0,0 +1,111 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.balanceplatform; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.balanceplatform.BalancePlatform; +import com.adyen.model.balanceplatform.PaginatedAccountHoldersResponse; +import com.adyen.model.balanceplatform.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class PlatformApi extends Service { + private final String baseURL; + + public PlatformApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Get a balance platform + * + * @param id {@link String } The unique identifier of the balance platform. (required) + * @return {@link BalancePlatform } + * @throws ApiException if fails to make API call + */ + public BalancePlatform getBalancePlatform(String id) throws ApiException, IOException { + return getBalancePlatform(id, null); + } + + /** + * Get a balance platform + * + * @param id {@link String } The unique identifier of the balance platform. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link BalancePlatform } + * @throws ApiException if fails to make API call + */ + public BalancePlatform getBalancePlatform(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/balancePlatforms/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return BalancePlatform.fromJson(jsonResult); + } + + /** + * Get all account holders under a balance platform + * + * @param id {@link String } The unique identifier of the balance platform. (required) + * @return {@link PaginatedAccountHoldersResponse } + * @throws ApiException if fails to make API call + */ + public PaginatedAccountHoldersResponse getAllAccountHoldersUnderBalancePlatform(String id) throws ApiException, IOException { + return getAllAccountHoldersUnderBalancePlatform(id, null, null, null); + } + + /** + * Get all account holders under a balance platform + * + * @param id {@link String } The unique identifier of the balance platform. (required) + * @param offset {@link Integer } Query: The number of items that you want to skip. (optional) + * @param limit {@link Integer } Query: The number of items returned per page, maximum 100 items. By default, the response returns 10 items per page. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link PaginatedAccountHoldersResponse } + * @throws ApiException if fails to make API call + */ + public PaginatedAccountHoldersResponse getAllAccountHoldersUnderBalancePlatform(String id, Integer offset, Integer limit, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + //Add query params + Map queryParams = new HashMap<>(); + if (offset != null) { + queryParams.put("offset", offset.toString()); + } + if (limit != null) { + queryParams.put("limit", limit.toString()); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/balancePlatforms/{id}/accountHolders", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams, queryParams); + return PaginatedAccountHoldersResponse.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/balanceplatform/TransactionRules.java b/src/main/java/com/adyen/service/balanceplatform/TransactionRules.java deleted file mode 100644 index c7ce9ad09..000000000 --- a/src/main/java/com/adyen/service/balanceplatform/TransactionRules.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.adyen.service.balanceplatform; - -import com.adyen.Client; -import com.adyen.Service; -import com.adyen.constants.ApiConstants; -import com.adyen.model.balanceplatform.TransactionRule; -import com.adyen.model.balanceplatform.TransactionRuleInfo; -import com.adyen.model.balanceplatform.TransactionRuleResponse; -import com.adyen.service.exception.ApiException; -import com.adyen.service.resource.balanceplatform.BalancePlatformResource; - -import java.io.IOException; - -public class TransactionRules extends Service { - - public TransactionRules(Client client) { - super(client); - } - - public TransactionRule create(TransactionRuleInfo request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - BalancePlatformResource resource = new BalancePlatformResource(this, "/transactionRules"); - String jsonResult = resource.request(jsonRequest); - return TransactionRule.fromJson(jsonResult); - } - - public TransactionRuleResponse retrieve(String transactionRuleId) throws IOException, ApiException { - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/transactionRules/%s", transactionRuleId)); - String jsonResult = resource.request(null, ApiConstants.HttpMethod.GET); - return TransactionRuleResponse.fromJson(jsonResult); - } - - public TransactionRule update(String transactionRuleId, TransactionRuleInfo request) throws IOException, ApiException { - String jsonRequest = request.toJson(); - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/transactionRules/%s", transactionRuleId)); - String jsonResult = resource.request(jsonRequest, ApiConstants.HttpMethod.PATCH); - return TransactionRule.fromJson(jsonResult); - } - - public void delete(String transactionRuleId) throws IOException, ApiException { - BalancePlatformResource resource = new BalancePlatformResource(this, String.format("/transactionRules/%s", transactionRuleId)); - resource.request(null, ApiConstants.HttpMethod.DELETE); - } -} diff --git a/src/main/java/com/adyen/service/balanceplatform/TransactionRulesApi.java b/src/main/java/com/adyen/service/balanceplatform/TransactionRulesApi.java new file mode 100644 index 000000000..fd5f1b98f --- /dev/null +++ b/src/main/java/com/adyen/service/balanceplatform/TransactionRulesApi.java @@ -0,0 +1,164 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service.balanceplatform; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.balanceplatform.RestServiceError; +import com.adyen.model.balanceplatform.TransactionRule; +import com.adyen.model.balanceplatform.TransactionRuleInfo; +import com.adyen.model.balanceplatform.TransactionRuleResponse; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class TransactionRulesApi extends Service { + private final String baseURL; + + public TransactionRulesApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Delete a transaction rule + * + * @param transactionRuleId {@link String } The unique identifier of the transaction rule. (required) + * @return {@link TransactionRule } + * @throws ApiException if fails to make API call + */ + public TransactionRule deleteTransactionRule(String transactionRuleId) throws ApiException, IOException { + return deleteTransactionRule(transactionRuleId, null); + } + + /** + * Delete a transaction rule + * + * @param transactionRuleId {@link String } The unique identifier of the transaction rule. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TransactionRule } + * @throws ApiException if fails to make API call + */ + public TransactionRule deleteTransactionRule(String transactionRuleId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (transactionRuleId == null) { + throw new IllegalArgumentException("Please provide the transactionRuleId path parameter"); + } + pathParams.put("transactionRuleId", transactionRuleId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/transactionRules/{transactionRuleId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.DELETE, pathParams); + return TransactionRule.fromJson(jsonResult); + } + + /** + * Get a transaction rule + * + * @param transactionRuleId {@link String } The unique identifier of the transaction rule. (required) + * @return {@link TransactionRuleResponse } + * @throws ApiException if fails to make API call + */ + public TransactionRuleResponse getTransactionRule(String transactionRuleId) throws ApiException, IOException { + return getTransactionRule(transactionRuleId, null); + } + + /** + * Get a transaction rule + * + * @param transactionRuleId {@link String } The unique identifier of the transaction rule. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TransactionRuleResponse } + * @throws ApiException if fails to make API call + */ + public TransactionRuleResponse getTransactionRule(String transactionRuleId, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (transactionRuleId == null) { + throw new IllegalArgumentException("Please provide the transactionRuleId path parameter"); + } + pathParams.put("transactionRuleId", transactionRuleId); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/transactionRules/{transactionRuleId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return TransactionRuleResponse.fromJson(jsonResult); + } + + /** + * Update a transaction rule + * + * @param transactionRuleId {@link String } The unique identifier of the transaction rule. (required) + * @param transactionRuleInfo {@link TransactionRuleInfo } (required) + * @return {@link TransactionRule } + * @throws ApiException if fails to make API call + */ + public TransactionRule updateTransactionRule(String transactionRuleId, TransactionRuleInfo transactionRuleInfo) throws ApiException, IOException { + return updateTransactionRule(transactionRuleId, transactionRuleInfo, null); + } + + /** + * Update a transaction rule + * + * @param transactionRuleId {@link String } The unique identifier of the transaction rule. (required) + * @param transactionRuleInfo {@link TransactionRuleInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TransactionRule } + * @throws ApiException if fails to make API call + */ + public TransactionRule updateTransactionRule(String transactionRuleId, TransactionRuleInfo transactionRuleInfo, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (transactionRuleId == null) { + throw new IllegalArgumentException("Please provide the transactionRuleId path parameter"); + } + pathParams.put("transactionRuleId", transactionRuleId); + + String requestBody = transactionRuleInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/transactionRules/{transactionRuleId}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.PATCH, pathParams); + return TransactionRule.fromJson(jsonResult); + } + + /** + * Create a transaction rule + * + * @param transactionRuleInfo {@link TransactionRuleInfo } (required) + * @return {@link TransactionRule } + * @throws ApiException if fails to make API call + */ + public TransactionRule createTransactionRule(TransactionRuleInfo transactionRuleInfo) throws ApiException, IOException { + return createTransactionRule(transactionRuleInfo, null); + } + + /** + * Create a transaction rule + * + * @param transactionRuleInfo {@link TransactionRuleInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link TransactionRule } + * @throws ApiException if fails to make API call + */ + public TransactionRule createTransactionRule(TransactionRuleInfo transactionRuleInfo, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = transactionRuleInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/transactionRules", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return TransactionRule.fromJson(jsonResult); + } +} diff --git a/src/test/java/com/adyen/BalancePlatformTest.java b/src/test/java/com/adyen/BalancePlatformTest.java index 6cf56e6f6..281a338d9 100644 --- a/src/test/java/com/adyen/BalancePlatformTest.java +++ b/src/test/java/com/adyen/BalancePlatformTest.java @@ -1,44 +1,24 @@ package com.adyen; -import com.adyen.model.balanceplatform.AccountHolder; -import com.adyen.model.balanceplatform.AccountHolderInfo; -import com.adyen.model.balanceplatform.BalanceAccount; -import com.adyen.model.balanceplatform.BalanceAccountInfo; -import com.adyen.model.balanceplatform.BalanceAccountUpdateRequest; -import com.adyen.model.balanceplatform.BalancePlatform; -import com.adyen.model.balanceplatform.BalanceSweepConfigurationsResponse; -import com.adyen.model.balanceplatform.BankAccountIdentificationValidationRequest; -import com.adyen.model.balanceplatform.PaginatedAccountHoldersResponse; -import com.adyen.model.balanceplatform.PaginatedBalanceAccountsResponse; -import com.adyen.model.balanceplatform.PaginatedPaymentInstrumentsResponse; -import com.adyen.model.balanceplatform.PaymentInstrument; -import com.adyen.model.balanceplatform.PaymentInstrumentGroup; -import com.adyen.model.balanceplatform.PaymentInstrumentGroupInfo; -import com.adyen.model.balanceplatform.PaymentInstrumentInfo; -import com.adyen.model.balanceplatform.PaymentInstrumentUpdateRequest; -import com.adyen.model.balanceplatform.SweepConfigurationV2; -import com.adyen.model.balanceplatform.TransactionRule; -import com.adyen.model.balanceplatform.TransactionRuleInfo; -import com.adyen.model.balanceplatform.TransactionRuleResponse; -import com.adyen.model.balanceplatform.TransactionRulesResponse; -import com.adyen.service.balanceplatform.AccountHolders; -import com.adyen.service.balanceplatform.BalanceAccounts; -import com.adyen.service.balanceplatform.BankAccountValidation; -import com.adyen.service.balanceplatform.General; -import com.adyen.service.balanceplatform.PaymentInstrumentGroups; -import com.adyen.service.balanceplatform.PaymentInstruments; -import com.adyen.service.balanceplatform.TransactionRules; +import com.adyen.constants.ApiConstants; +import com.adyen.model.balanceplatform.*; + +import com.adyen.service.balanceplatform.*; import org.junit.Test; +import java.util.HashMap; +import java.util.Map; + import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.verify; public class BalancePlatformTest extends BaseTest { @Test public void GeneralRetrieveTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/BalancePlatformResponse.json"); - General service = new General(client); - BalancePlatform response = service.retrieve("123456789"); + PlatformApi service = new PlatformApi(client); + BalancePlatform response = service.getBalancePlatform("123456789"); assertEquals("123456789" ,response.getId()); assertEquals("active" ,response.getStatus()); } @@ -46,8 +26,8 @@ public void GeneralRetrieveTest() throws Exception { @Test public void GeneralListAccountHoldersTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/PaginatedAccountHoldersResponse.json"); - General service = new General(client); - PaginatedAccountHoldersResponse response = service.listAccountHolders("LE322KT223222D5FJ7THR293F", null); + PlatformApi service = new PlatformApi(client); + PaginatedAccountHoldersResponse response = service.getAllAccountHoldersUnderBalancePlatform("LE322KT223222D5FJ7THR293F",10,10 ,null); assertEquals("123456789" ,response.getAccountHolders().get(0).getId()); assertEquals("LE322KT223222D5FJ7THR293F" ,response.getAccountHolders().get(0).getLegalEntityId()); } @@ -55,7 +35,7 @@ public void GeneralListAccountHoldersTest() throws Exception { @Test public void AccountHoldersCreateTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/AccountHolderCreatedResponse.json"); - AccountHolders service = new AccountHolders(client); + AccountHoldersApi service = new AccountHoldersApi(client); AccountHolderInfo request = AccountHolderInfo.fromJson("{\n" + " \"balancePlatform\": \"YOUR_BALANCE_PLATFORM\",\n" + " \"description\": \"S.Hopper - Staff 123\",\n" + @@ -75,22 +55,22 @@ public void AccountHoldersCreateTest() throws Exception { " }\n" + " }\n" + "}"); - AccountHolder response = service.create(request); + AccountHolder response = service.createAccountHolder(request); assertEquals("AH3227C223222B5CMD2SXFKGT" ,response.getId()); assertEquals("LE322KT223222D5FJ7THR293F" ,response.getLegalEntityId()); } @Test public void AccountHoldersRetrieveTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/AccountHolder.json"); - AccountHolders service = new AccountHolders(client); - AccountHolder response = service.retrieve("LE322KT223222D5FJ7THR293F"); + AccountHoldersApi service = new AccountHoldersApi(client); + AccountHolder response = service.getAccountHolder("LE322KT223222D5FJ7THR293F"); assertEquals("AH3227C223222B5CMD2SXFKGT" ,response.getId()); assertEquals("LE322KT223222D5FJ7THR293F" ,response.getLegalEntityId()); } @Test public void AccountHoldersUpdateTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/AccountHolder.json"); - AccountHolders service = new AccountHolders(client); + AccountHoldersApi service = new AccountHoldersApi(client); AccountHolder request = AccountHolder.fromJson("{\n" + " \"balancePlatform\": \"YOUR_BALANCE_PLATFORM\",\n" + " \"contactDetails\": {\n" + @@ -112,27 +92,39 @@ public void AccountHoldersUpdateTest() throws Exception { " \"id\": \"AH32272223222B5CM4MWJ892H\",\n" + " \"status\": \"active\"\n" + "}"); - AccountHolder response = service.update("AH3227C223222B5CMD2SXFKGT", request); + AccountHolder response = service.updateAccountHolder("AH3227C223222B5CMD2SXFKGT", request); assertEquals("AH3227C223222B5CMD2SXFKGT" ,response.getId()); assertEquals("LE322KT223222D5FJ7THR293F" ,response.getLegalEntityId()); } @Test public void AccountHolderListTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/PaginatedBalanceAccountsResponse.json"); - AccountHolders service = new AccountHolders(client); - PaginatedBalanceAccountsResponse response = service.list("AH3227C223222B5CMD2SXFKGT", null); + AccountHoldersApi service = new AccountHoldersApi(client); + PaginatedBalanceAccountsResponse response = service.getAllBalanceAccountsOfAccountHolder("AH3227C223222B5CMD2SXFKGT", 10, 10, null); assertEquals("AH32272223222B59K6ZKBBFNQ" ,response.getBalanceAccounts().get(0).getAccountHolderId()); assertEquals("BA32272223222B59K6ZXHBFN6" ,response.getBalanceAccounts().get(0).getId()); + Map queryMap = new HashMap<>(); + queryMap.put("offset", "10"); + queryMap.put("limit", "10"); + verify(client.getHttpClient()).request( + "https://balanceplatform-api-test.adyen.com/bcl/v2/accountHolders/AH3227C223222B5CMD2SXFKGT/balanceAccounts", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + queryMap + ); } @Test public void BalanceAccountsCreateTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/BalanceAccount.json"); - BalanceAccounts service = new BalanceAccounts(client); + BalanceAccountsApi service = new BalanceAccountsApi(client); BalanceAccountInfo request = BalanceAccountInfo.fromJson("{\n" + " \"accountHolderId\": \"AH32272223222B59K6ZKBBFNQ\",\n" + " \"description\": \"S.Hopper - Main balance account\"\n" + "}"); - BalanceAccount response = service.create(request); + BalanceAccount response = service.createBalanceAccount(request); assertEquals("AH32272223222B59K6ZKBBFNQ", response.getAccountHolderId()); assertEquals("BA32272223222B59CZ3T52DKZ", response.getId()); } @@ -140,8 +132,8 @@ public void BalanceAccountsCreateTest() throws Exception { @Test public void BalanceAccountsRetrieveTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/BalanceAccount.json"); - BalanceAccounts service = new BalanceAccounts(client); - BalanceAccount response = service.retrieve("AH32272223222B59K6ZKBBFNQ"); + BalanceAccountsApi service = new BalanceAccountsApi(client); + BalanceAccount response = service.getBalanceAccount("AH32272223222B59K6ZKBBFNQ"); assertEquals("AH32272223222B59K6ZKBBFNQ", response.getAccountHolderId()); assertEquals("BA32272223222B59CZ3T52DKZ", response.getId()); } @@ -149,14 +141,14 @@ public void BalanceAccountsRetrieveTest() throws Exception { @Test public void BalanceAccountsUpdateTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/BalanceAccount.json"); - BalanceAccounts service = new BalanceAccounts(client); + BalanceAccountsApi service = new BalanceAccountsApi(client); BalanceAccountUpdateRequest request = BalanceAccountUpdateRequest.fromJson("{\n" + " \"accountHolderId\": \"AH32272223222B59K6ZKBBFNQ\",\n" + " \"defaultCurrencyCode\": \"EUR\",\n" + " \"reference\": \"S.Hopper - Main balance account\",\n" + " \"status\": \"active\"\n" + "}"); - BalanceAccount response = service.update("AH32272223222B59K6ZKBBFNQ", request); + BalanceAccount response = service.updateBalanceAccount("AH32272223222B59K6ZKBBFNQ", request); assertEquals("AH32272223222B59K6ZKBBFNQ", response.getAccountHolderId()); assertEquals("BA32272223222B59CZ3T52DKZ", response.getId()); } @@ -164,8 +156,8 @@ public void BalanceAccountsUpdateTest() throws Exception { @Test public void BalanceAccountsListSweepsTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/BalanceSweepConfigurationsResponse.json"); - BalanceAccounts service = new BalanceAccounts(client); - BalanceSweepConfigurationsResponse response = service.listSweeps("AH32272223222B59K6ZKBBFNQ", null); + BalanceAccountsApi service = new BalanceAccountsApi(client); + BalanceSweepConfigurationsResponse response = service.getAllSweepsForBalanceAccount("AH32272223222B59K6ZKBBFNQ"); assertEquals("SWPC4227C224555B5FTD2NT2JV4WN5", response.getSweeps().get(0).getId()); assertEquals("BA32272223222B5FTD2KR6TJD", response.getSweeps().get(0).getCounterparty().getBalanceAccountId()); } @@ -173,7 +165,7 @@ public void BalanceAccountsListSweepsTest() throws Exception { @Test public void BalanceAccountsCreateSweepTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/SweepConfigurationV2.json"); - BalanceAccounts service = new BalanceAccounts(client); + BalanceAccountsApi service = new BalanceAccountsApi(client); SweepConfigurationV2 request = SweepConfigurationV2.fromJson("{\n" + " \"counterparty\": {\n" + " \"merchantAccount\": \"YOUR_MERCHANT_ACCOUNT\"\n" + @@ -198,15 +190,15 @@ public void BalanceAccountsCreateSweepTest() throws Exception { @Test public void BalanceAccountsDeleteSweepTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/BalanceSweepConfigurationsResponse.json"); - BalanceAccounts service = new BalanceAccounts(client); + BalanceAccountsApi service = new BalanceAccountsApi(client); service.deleteSweep("AH32272223222B59K6ZKBBFNQ", "SWPC4227C224555B5FTD2NT2JV4WN5"); } @Test public void BalanceAccountsRetrieveSweepTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/SweepConfigurationV2.json"); - BalanceAccounts service = new BalanceAccounts(client); - SweepConfigurationV2 response = service.retrieveSweep("AH32272223222B59K6ZKBBFNQ", "SWPC4227C224555B5FTD2NT2JV4WN5"); + BalanceAccountsApi service = new BalanceAccountsApi(client); + SweepConfigurationV2 response = service.getSweep("AH32272223222B59K6ZKBBFNQ", "SWPC4227C224555B5FTD2NT2JV4WN5"); assertEquals("SWPC4227C224555B5FTD2NT2JV4WN5", response.getId()); assertEquals("BA32272223222B5FTD2KR6TJD", response.getCounterparty().getBalanceAccountId()); } @@ -214,7 +206,7 @@ public void BalanceAccountsRetrieveSweepTest() throws Exception { @Test public void BalanceAccountsUpdateSweepTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/SweepConfigurationV2.json"); - BalanceAccounts service = new BalanceAccounts(client); + BalanceAccountsApi service = new BalanceAccountsApi(client); SweepConfigurationV2 request = SweepConfigurationV2.fromJson("{\n" + " \"counterparty\": {\n" + " \"merchantAccount\": \"YOUR_MERCHANT_ACCOUNT\"\n" + @@ -239,8 +231,8 @@ public void BalanceAccountsUpdateSweepTest() throws Exception { @Test public void BalanceAccountsListPaymentInstrumentsTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/PaginatedPaymentInstrumentsResponse.json"); - BalanceAccounts service = new BalanceAccounts(client); - PaginatedPaymentInstrumentsResponse response = service.listPaymentInstruments("AH32272223222B59K6ZKBBFNQ", null); + BalanceAccountsApi service = new BalanceAccountsApi(client); + PaginatedPaymentInstrumentsResponse response = service.getAllPaymentInstrumentsForBalanceAccount("AH32272223222B59K6ZKBBFNQ"); assertEquals("PI32272223222B59M5TM658DT", response.getPaymentInstruments().get(0).getId()); assertEquals("BA32272223222B59CZ3T52DKZ", response.getPaymentInstruments().get(0).getBalanceAccountId()); } @@ -248,14 +240,14 @@ public void BalanceAccountsListPaymentInstrumentsTest() throws Exception { @Test public void PaymentInstrumentsCreateTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/PaymentInstrument.json"); - PaymentInstruments service = new PaymentInstruments(client); + PaymentInstrumentsApi service = new PaymentInstrumentsApi(client); PaymentInstrumentInfo request = PaymentInstrumentInfo.fromJson("{\n" + " \"type\": \"bankAccount\",\n" + " \"description\": \"YOUR_DESCRIPTION\",\n" + " \"balanceAccountId\": \"BA3227C223222B5CTBLR8BWJB\",\n" + " \"issuingCountryCode\": \"NL\"\n" + "}"); - PaymentInstrument response = service.create(request); + PaymentInstrument response = service.createPaymentInstrument(request); assertEquals("PI32272223222C5GXTDWH3TTN", response.getId()); assertEquals("BA3227C223222B5FG88S28BGN", response.getBalanceAccountId()); } @@ -263,8 +255,8 @@ public void PaymentInstrumentsCreateTest() throws Exception { @Test public void PaymentInstrumentsRetrieveTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/PaymentInstrument.json"); - PaymentInstruments service = new PaymentInstruments(client); - PaymentInstrument response = service.retrieve("PI322LJ223222B5DJS7CD9LWL"); + PaymentInstrumentsApi service = new PaymentInstrumentsApi(client); + PaymentInstrument response = service.getPaymentInstrument("PI322LJ223222B5DJS7CD9LWL"); assertEquals("PI32272223222C5GXTDWH3TTN", response.getId()); assertEquals("BA3227C223222B5FG88S28BGN", response.getBalanceAccountId()); } @@ -272,11 +264,11 @@ public void PaymentInstrumentsRetrieveTest() throws Exception { @Test public void PaymentInstrumentsUpdateTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/PaymentInstrument.json"); - PaymentInstruments service = new PaymentInstruments(client); + PaymentInstrumentsApi service = new PaymentInstrumentsApi(client); PaymentInstrumentUpdateRequest request = PaymentInstrumentUpdateRequest.fromJson("{\n" + " \"balanceAccountId\": \"BA32272223222B5CM82WL892M\"\n" + "}"); - PaymentInstrument response = service.update("PI322LJ223222B5DJS7CD9LWL", request); + UpdatePaymentInstrument response = service.updatePaymentInstrument("PI322LJ223222B5DJS7CD9LWL", request); assertEquals("PI32272223222C5GXTDWH3TTN", response.getId()); assertEquals("BA3227C223222B5FG88S28BGN", response.getBalanceAccountId()); } @@ -284,8 +276,8 @@ public void PaymentInstrumentsUpdateTest() throws Exception { @Test public void PaymentInstrumentsListTransactionRulesTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/TransactionRulesResponse.json"); - PaymentInstruments service = new PaymentInstruments(client); - TransactionRulesResponse response = service.listTransactionRules("TR3227C223222B5FCB756DV9H"); + PaymentInstrumentsApi service = new PaymentInstrumentsApi(client); + TransactionRulesResponse response = service.getAllTransactionRulesForPaymentInstrument("TR3227C223222B5FCB756DV9H"); assertEquals("TR3227C223222B5FCB756DV9H", response.getTransactionRules().get(0).getId()); assertEquals("PI3227C223222B5BPCMFXD2XG", response.getTransactionRules().get(0).getEntityKey().getEntityReference()); } @@ -293,28 +285,28 @@ public void PaymentInstrumentsListTransactionRulesTest() throws Exception { @Test public void PaymentInstrumentGroupsCreateTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/PaymentInstrumentGroup.json"); - PaymentInstrumentGroups service = new PaymentInstrumentGroups(client); + PaymentInstrumentGroupsApi service = new PaymentInstrumentGroupsApi(client); PaymentInstrumentGroupInfo request = PaymentInstrumentGroupInfo.fromJson("{\n" + " \"balancePlatform\": \"YOUR_BALANCE_PLATFORM\",\n" + " \"txVariant\": \"mc\"\n" + "}"); - PaymentInstrumentGroup response = service.create(request); + PaymentInstrumentGroup response = service.createPaymentInstrumentGroup(request); assertEquals("PG3227C223222B5CMD3FJFKGZ", response.getId()); } @Test public void PaymentInstrumentGroupsRetrieveTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/PaymentInstrumentGroup.json"); - PaymentInstrumentGroups service = new PaymentInstrumentGroups(client); - PaymentInstrumentGroup response = service.retrieve("PG3227C223222B5CMD3FJFKGZ"); + PaymentInstrumentGroupsApi service = new PaymentInstrumentGroupsApi(client); + PaymentInstrumentGroup response = service.getPaymentInstrumentGroup("PG3227C223222B5CMD3FJFKGZ"); assertEquals("PG3227C223222B5CMD3FJFKGZ", response.getId()); } @Test public void PaymentInstrumentGroupsListTransactionRulesTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/TransactionRulesResponse.json"); - PaymentInstrumentGroups service = new PaymentInstrumentGroups(client); - TransactionRulesResponse response = service.listTransactionRules("TR3227C223222B5FCB756DV9H"); + PaymentInstrumentGroupsApi service = new PaymentInstrumentGroupsApi(client); + TransactionRulesResponse response = service.getAllTransactionRulesForPaymentInstrumentGroup("TR3227C223222B5FCB756DV9H"); assertEquals("TR3227C223222B5FCB756DV9H", response.getTransactionRules().get(0).getId()); assertEquals("PI3227C223222B5BPCMFXD2XG", response.getTransactionRules().get(0).getEntityKey().getEntityReference()); } @@ -322,7 +314,7 @@ public void PaymentInstrumentGroupsListTransactionRulesTest() throws Exception { @Test public void TransactionRulesCreateTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/TransactionRule.json"); - TransactionRules service = new TransactionRules(client); + TransactionRulesApi service = new TransactionRulesApi(client); TransactionRuleInfo request = TransactionRuleInfo.fromJson("{\n" + " \"description\": \"Allow only point-of-sale transactions\",\n" + " \"reference\": \"YOUR_REFERENCE_4F7346\",\n" + @@ -344,7 +336,7 @@ public void TransactionRulesCreateTest() throws Exception { " },\n" + " \"type\": \"blockList\"\n" + "}"); - TransactionRule response = service.create(request); + TransactionRule response = service.createTransactionRule(request); assertEquals("TR3227C223222B5FCB756DV9H", response.getId()); assertEquals("PI3227C223222B5BPCMFXD2XG", response.getEntityKey().getEntityReference()); } @@ -352,15 +344,15 @@ public void TransactionRulesCreateTest() throws Exception { @Test public void TransactionRulesRetrieveTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/TransactionRuleResponse.json"); - TransactionRules service = new TransactionRules(client); - TransactionRuleResponse response = service.retrieve("TR32272223222B5CMD3V73HXG"); + TransactionRulesApi service = new TransactionRulesApi(client); + TransactionRuleResponse response = service.getTransactionRule("TR32272223222B5CMD3V73HXG"); assertEquals("TR3227C223222B5FCB756DV9H", response.getTransactionRule().getId()); } @Test public void TransactionRulesUpdateTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/TransactionRule.json"); - TransactionRules service = new TransactionRules(client); + TransactionRulesApi service = new TransactionRulesApi(client); TransactionRuleInfo request = TransactionRuleInfo.fromJson("{\n" + " \"description\": \"Allow only point-of-sale transactions\",\n" + " \"reference\": \"YOUR_REFERENCE_4F7346\",\n" + @@ -382,7 +374,7 @@ public void TransactionRulesUpdateTest() throws Exception { " },\n" + " \"type\": \"blockList\"\n" + "}"); - TransactionRule response = service.update("TR3227C223222B5FCB756DV9H", request); + TransactionRule response = service.updateTransactionRule("TR3227C223222B5FCB756DV9H", request); assertEquals("TR3227C223222B5FCB756DV9H", response.getId()); assertEquals("PI3227C223222B5BPCMFXD2XG", response.getEntityKey().getEntityReference()); } @@ -390,15 +382,24 @@ public void TransactionRulesUpdateTest() throws Exception { @Test public void TransactionRulesDeleteTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/TransactionRule.json"); - TransactionRules service = new TransactionRules(client); - service.delete("TR3227C223222B5FCB756DV9H"); + TransactionRulesApi service = new TransactionRulesApi(client); + service.deleteTransactionRule("TR3227C223222B5FCB756DV9H"); } @Test public void ValidateBankAccountIdentificationTest() throws Exception { Client client = createMockClientFromFile("mocks/balancePlatform/TransactionRule.json"); - BankAccountValidation service = new BankAccountValidation(client); + BankAccountValidationApi service = new BankAccountValidationApi(client); service.validateBankAccountIdentification(new BankAccountIdentificationValidationRequest()); + verify(client.getHttpClient()).request( + "https://balanceplatform-api-test.adyen.com/bcl/v2/validateBankAccountIdentification", + "{}", + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.POST, + null + ); } From 80d8f3646cfba62f86d9ac7403c1bfc71ef46e5f Mon Sep 17 00:00:00 2001 From: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com> Date: Wed, 10 May 2023 12:51:59 +0200 Subject: [PATCH 30/32] Add Feedback section to README (#1019) * Add Feedback section to README * Move feedback section --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c93e75b96..701454da1 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,8 @@ For a closer look at how our Java library works, you can clone one of our exampl These include commented code, highlighting key features and concepts, and examples of API calls that can be made using the library. +## Feedback +We value your input! Help us enhance our API Libraries and improve the integration experience by providing your feedback. Please take a moment to fill out [our feedback form](https://forms.gle/A4EERrR6CWgKWe5r9) to share your thoughts, suggestions or ideas. ## Contributing From 0389ee2d054838fd9723916e2e6f2badae0092d1 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Fri, 12 May 2023 14:20:35 +0200 Subject: [PATCH 31/32] Update README.md (#1014) * Update README.md * Update README.md Co-authored-by: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com> * Update README.md Co-authored-by: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com> * Update README.md --------- Co-authored-by: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com> --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 701454da1..df4435e67 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ The Library supports all APIs under the following services: | API | Description | Service Name | Supported version | |----------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|-------------------| -| [BIN lookup API](https://docs.adyen.com/api-explorer/#/BinLookup/v52/overview) | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | BinLookup | **v52** | -| [Checkout API](https://docs.adyen.com/api-explorer/#/CheckoutService/v69/overview) | Our latest integration for accepting online payments. | Checkout | **v69** | +| [BIN lookup API](https://docs.adyen.com/api-explorer/#/BinLookup/v54/overview) | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | BinLookup | **v54** | +| [Checkout API](https://docs.adyen.com/api-explorer/#/CheckoutService/v70/overview) | Our latest integration for accepting online payments. | Checkout | **v70** | | [Configuration API](https://docs.adyen.com/api-explorer/#/balanceplatform/v2/overview) | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | balanceplatform package subclasses | **v2** | | [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) | Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email) | DataProtection | **v1** | -| [Legal Entity Management API](https://docs.adyen.com/api-explorer/#/legalentity/v2/overview) | Manage legal entities that contain information required for verification. | legalentitymanagement package subclasses | **v3** | +| [Legal Entity Management API](https://docs.adyen.com/api-explorer/#/legalentity/v3/overview) | Manage legal entities that contain information required for verification. | legalentitymanagement package subclasses | **v3** | | [Local/Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/terminal-api-reference) | Our point-of-sale integration. | TerminalLocalAPI or TerminalCloudAPI | - | | [Management API](https://docs.adyen.com/api-explorer/#/ManagementService/v1/overview) | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | management package subclasses | **v1** | | [Payments API](https://docs.adyen.com/api-explorer/#/Payment/v68/overview) | Our classic integration for online payments. | Payment | **v68** | From 08cd39cb175bdb2579a8f49f1df6ea5c7441acb0 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Fri, 12 May 2023 14:27:23 +0200 Subject: [PATCH 32/32] [ITT-500/ITT-549] Release v20 (#1020) * make models for release * Add Capital API (ITT-549) * bump versions and polish readme * Update README.md --- Makefile | 4 +- README.md | 9 +- pom.xml | 2 +- src/main/java/com/adyen/Client.java | 2 +- .../model/capital/AbstractOpenApiSchema.java | 145 +++++ .../java/com/adyen/model/capital/Amount.java | 247 ++++++++ .../adyen/model/capital/CapitalBalance.java | 307 ++++++++++ .../com/adyen/model/capital/CapitalGrant.java | 542 ++++++++++++++++++ .../adyen/model/capital/CapitalGrantInfo.java | 285 +++++++++ .../adyen/model/capital/CapitalGrants.java | 233 ++++++++ .../com/adyen/model/capital/Counterparty.java | 275 +++++++++ .../java/com/adyen/model/capital/Fee.java | 218 +++++++ .../com/adyen/model/capital/InvalidField.java | 285 +++++++++ .../java/com/adyen/model/capital/JSON.java | 413 +++++++++++++ .../com/adyen/model/capital/JSONObject.java | 261 +++++++++ .../com/adyen/model/capital/JSONPath.java | 219 +++++++ .../com/adyen/model/capital/Repayment.java | 281 +++++++++ .../adyen/model/capital/RepaymentTerm.java | 242 ++++++++ .../adyen/model/capital/RestServiceError.java | 501 ++++++++++++++++ .../model/capital/ThresholdRepayment.java | 218 +++++++ .../com/adyen/model/checkout/AccountInfo.java | 9 + .../com/adyen/model/checkout/AchDetails.java | 3 + .../checkout/AdditionalData3DSecure.java | 6 + .../adyen/model/checkout/AfterpayDetails.java | 3 + .../adyen/model/checkout/ApplePayDetails.java | 3 + .../checkout/BacsDirectDebitDetails.java | 3 + .../com/adyen/model/checkout/BlikDetails.java | 3 + .../com/adyen/model/checkout/CardDetails.java | 6 + .../checkout/CheckoutBalanceCheckRequest.java | 3 + .../CreateCheckoutSessionRequest.java | 3 + .../CreateCheckoutSessionResponse.java | 3 + .../adyen/model/checkout/DetailsRequest.java | 3 + .../GenericIssuerPaymentMethodDetails.java | 3 + .../adyen/model/checkout/GiropayDetails.java | 3 + .../model/checkout/GooglePayDetails.java | 3 + .../adyen/model/checkout/IdealDetails.java | 3 + .../com/adyen/model/checkout/InputDetail.java | 3 + .../adyen/model/checkout/KlarnaDetails.java | 3 + .../model/checkout/MerchantRiskIndicator.java | 3 + .../model/checkout/OpenInvoiceDetails.java | 3 + .../adyen/model/checkout/PayPalDetails.java | 3 + .../adyen/model/checkout/PayUUpiDetails.java | 3 + .../model/checkout/PayWithGoogleDetails.java | 3 + .../checkout/PaymentDonationRequest.java | 6 + .../adyen/model/checkout/PaymentMethod.java | 3 + .../adyen/model/checkout/PaymentRequest.java | 6 + .../model/checkout/PaymentSetupRequest.java | 6 + .../model/checkout/PaymentSetupResponse.java | 3 + .../adyen/model/checkout/RatepayDetails.java | 3 + .../adyen/model/checkout/RecurringDetail.java | 3 + .../model/checkout/SamsungPayDetails.java | 3 + .../checkout/SepaDirectDebitDetails.java | 3 + .../checkout/StoredPaymentMethodDetails.java | 3 + .../model/checkout/ThreeDS2RequestData.java | 6 + .../model/checkout/UpiCollectDetails.java | 3 + .../model/checkout/UpiIntentDetails.java | 3 + .../adyen/model/checkout/VippsDetails.java | 3 + .../com/adyen/model/checkout/ZipDetails.java | 3 + .../model/legalentitymanagement/Address.java | 4 +- .../legalentitymanagement/Attachment.java | 6 + .../BankAccountInfo.java | 3 + .../legalentitymanagement/BusinessLine.java | 3 + .../BusinessLineInfo.java | 3 + .../BusinessLineInfoUpdate.java | 3 + .../model/legalentitymanagement/Document.java | 15 +- .../IdentificationData.java | 12 +- .../legalentitymanagement/LegalEntity.java | 3 + .../LegalEntityAssociation.java | 10 +- .../legalentitymanagement/Organization.java | 6 +- .../legalentitymanagement/SourceOfFunds.java | 3 + .../java/com/adyen/model/management/Nexo.java | 3 + .../ScheduleTerminalActionsResponse.java | 3 + .../com/adyen/model/payment/AccountInfo.java | 9 + .../model/payment/MerchantRiskIndicator.java | 3 + .../model/payment/ThreeDS2RequestData.java | 6 + .../com/adyen/model/transfers/Transfer.java | 6 + .../java/com/adyen/service/CapitalApi.java | 128 +++++ .../BankAccountValidationApi.java | 2 - .../legalentitymanagement/DocumentsApi.java | 2 - src/test/java/com/adyen/CapitalTest.java | 50 ++ .../mocks/capital/get-capital-account.json | 44 ++ .../mocks/capital/request-grant.json | 31 + 82 files changed, 5158 insertions(+), 27 deletions(-) create mode 100644 src/main/java/com/adyen/model/capital/AbstractOpenApiSchema.java create mode 100644 src/main/java/com/adyen/model/capital/Amount.java create mode 100644 src/main/java/com/adyen/model/capital/CapitalBalance.java create mode 100644 src/main/java/com/adyen/model/capital/CapitalGrant.java create mode 100644 src/main/java/com/adyen/model/capital/CapitalGrantInfo.java create mode 100644 src/main/java/com/adyen/model/capital/CapitalGrants.java create mode 100644 src/main/java/com/adyen/model/capital/Counterparty.java create mode 100644 src/main/java/com/adyen/model/capital/Fee.java create mode 100644 src/main/java/com/adyen/model/capital/InvalidField.java create mode 100644 src/main/java/com/adyen/model/capital/JSON.java create mode 100644 src/main/java/com/adyen/model/capital/JSONObject.java create mode 100644 src/main/java/com/adyen/model/capital/JSONPath.java create mode 100644 src/main/java/com/adyen/model/capital/Repayment.java create mode 100644 src/main/java/com/adyen/model/capital/RepaymentTerm.java create mode 100644 src/main/java/com/adyen/model/capital/RestServiceError.java create mode 100644 src/main/java/com/adyen/model/capital/ThresholdRepayment.java create mode 100644 src/main/java/com/adyen/service/CapitalApi.java create mode 100644 src/test/java/com/adyen/CapitalTest.java create mode 100644 src/test/resources/mocks/capital/get-capital-account.json create mode 100644 src/test/resources/mocks/capital/request-grant.json diff --git a/Makefile b/Makefile index 44fcaa486..1fa5296a0 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,8 @@ binlookup: smallServiceName=BinLookupApi checkout: spec=CheckoutService-v70 dataprotection: spec=DataProtectionService-v1 dataprotection: smallServiceName=DataProtectionApi +capital: spec=GrantService-v3 +capital: smallServiceName=CapitalApi storedvalue: spec=StoredValueService-v46 storedvalue: smallServiceName=StoredValueApi posterminalmanagement: spec=TfmAPIService-v1 @@ -63,7 +65,7 @@ $(services): target/spec $(openapi-generator-jar) # Full service + models automation bigServices:=balanceplatform checkout storedValue payout management legalentitymanagement transfers -singleFileServices:=balancecontrol binlookup dataprotection storedvalue posterminalmanagement recurring payment +singleFileServices:=balancecontrol binlookup dataprotection storedvalue posterminalmanagement recurring payment capital services: $(bigServices) $(singleFileServices) diff --git a/README.md b/README.md index df4435e67..b518e7a8c 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,12 @@ The Library supports all APIs under the following services: | API | Description | Service Name | Supported version | |----------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|-------------------| -| [BIN lookup API](https://docs.adyen.com/api-explorer/#/BinLookup/v54/overview) | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | BinLookup | **v54** | -| [Checkout API](https://docs.adyen.com/api-explorer/#/CheckoutService/v70/overview) | Our latest integration for accepting online payments. | Checkout | **v70** | +| [BIN lookup API](https://docs.adyen.com/api-explorer/BinLookup/54/overview) | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | BinLookup | **v54** | +| [Capital API](https://docs.adyen.com/api-explorer/capital/3/overview) | Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. | Capital | **v3** | +| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/70/overview) | Our latest integration for accepting online payments. | Checkout | **v70** | | [Configuration API](https://docs.adyen.com/api-explorer/#/balanceplatform/v2/overview) | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | balanceplatform package subclasses | **v2** | | [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) | Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email) | DataProtection | **v1** | -| [Legal Entity Management API](https://docs.adyen.com/api-explorer/#/legalentity/v3/overview) | Manage legal entities that contain information required for verification. | legalentitymanagement package subclasses | **v3** | +| [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | Manage legal entities that contain information required for verification. | legalentitymanagement package subclasses | **v3** | | [Local/Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/terminal-api-reference) | Our point-of-sale integration. | TerminalLocalAPI or TerminalCloudAPI | - | | [Management API](https://docs.adyen.com/api-explorer/#/ManagementService/v1/overview) | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | management package subclasses | **v1** | | [Payments API](https://docs.adyen.com/api-explorer/#/Payment/v68/overview) | Our classic integration for online payments. | Payment | **v68** | @@ -49,7 +50,7 @@ You can use Maven and add this dependency to your project's POM: com.adyen adyen-java-api-library - 19.0.0 + 20.0.0 ``` diff --git a/pom.xml b/pom.xml index b6f9a7e12..f7af49905 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.adyen adyen-java-api-library jar - 19.0.0 + 20.0.0 Adyen Java API Library Adyen API Client Library for Java https://github.com/adyen/adyen-java-api-library diff --git a/src/main/java/com/adyen/Client.java b/src/main/java/com/adyen/Client.java index ff4bcd57c..26a93c84b 100644 --- a/src/main/java/com/adyen/Client.java +++ b/src/main/java/com/adyen/Client.java @@ -44,7 +44,7 @@ public class Client { public static final String MARKETPAY_NOTIFICATION_API_VERSION = "v6"; public static final String MARKETPAY_HOP_API_VERSION = "v6"; public static final String LIB_NAME = "adyen-java-api-library"; - public static final String LIB_VERSION = "19.0.0"; + public static final String LIB_VERSION = "20.0.0"; public static final String CHECKOUT_ENDPOINT_TEST = "https://checkout-test.adyen.com/checkout"; public static final String CHECKOUT_ENDPOINT_LIVE_SUFFIX = "-checkout-live.adyenpayments.com/checkout"; public static final String CHECKOUT_ENDPOINT_CERT_LIVE = "https://checkoutcert-live-%s.adyen.com/checkout"; diff --git a/src/main/java/com/adyen/model/capital/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/capital/AbstractOpenApiSchema.java new file mode 100644 index 000000000..66f0ed9f8 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/AbstractOpenApiSchema.java @@ -0,0 +1,145 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; +import jakarta.ws.rs.core.GenericType; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/src/main/java/com/adyen/model/capital/Amount.java b/src/main/java/com/adyen/model/capital/Amount.java new file mode 100644 index 000000000..c2e74bef1 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/Amount.java @@ -0,0 +1,247 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.capital.JSON; + +/** + * Amount + */ + +public class Amount { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private Long value; + + public Amount() { + } + + public Amount currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @return currency + **/ + @ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).") + + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + + public Amount value(Long value) { + + this.value = value; + return this; + } + + /** + * The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * @return value + **/ + @ApiModelProperty(required = true, value = "The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).") + + public Long getValue() { + return value; + } + + + public void setValue(Long value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Amount amount = (Amount) o; + return Objects.equals(this.currency, amount.currency) && + Objects.equals(this.value, amount.value); + } + + @Override + public int hashCode() { + return Objects.hash(currency, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Amount {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("currency"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("currency"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Amount + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Amount.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Amount is not found in the empty JSON string", Amount.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Amount.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Amount` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Amount.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field currency + if (jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Amount.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Amount' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Amount.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Amount value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Amount read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Amount given an JSON string + * + * @param jsonString JSON string + * @return An instance of Amount + * @throws IOException if the JSON string is invalid with respect to Amount + */ + public static Amount fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Amount.class); + } + + /** + * Convert an instance of Amount to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/capital/CapitalBalance.java b/src/main/java/com/adyen/model/capital/CapitalBalance.java new file mode 100644 index 000000000..a572c746d --- /dev/null +++ b/src/main/java/com/adyen/model/capital/CapitalBalance.java @@ -0,0 +1,307 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.capital.JSON; + +/** + * CapitalBalance + */ + +public class CapitalBalance { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_FEE = "fee"; + @SerializedName(SERIALIZED_NAME_FEE) + private Long fee; + + public static final String SERIALIZED_NAME_PRINCIPAL = "principal"; + @SerializedName(SERIALIZED_NAME_PRINCIPAL) + private Long principal; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + private Long total; + + public CapitalBalance() { + } + + public CapitalBalance currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @return currency + **/ + @ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).") + + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + + public CapitalBalance fee(Long fee) { + + this.fee = fee; + return this; + } + + /** + * Fee amount. + * @return fee + **/ + @ApiModelProperty(required = true, value = "Fee amount.") + + public Long getFee() { + return fee; + } + + + public void setFee(Long fee) { + this.fee = fee; + } + + + public CapitalBalance principal(Long principal) { + + this.principal = principal; + return this; + } + + /** + * Principal amount. + * @return principal + **/ + @ApiModelProperty(required = true, value = "Principal amount.") + + public Long getPrincipal() { + return principal; + } + + + public void setPrincipal(Long principal) { + this.principal = principal; + } + + + public CapitalBalance total(Long total) { + + this.total = total; + return this; + } + + /** + * Total amount. A sum of principal amount and fee amount. + * @return total + **/ + @ApiModelProperty(required = true, value = "Total amount. A sum of principal amount and fee amount.") + + public Long getTotal() { + return total; + } + + + public void setTotal(Long total) { + this.total = total; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CapitalBalance capitalBalance = (CapitalBalance) o; + return Objects.equals(this.currency, capitalBalance.currency) && + Objects.equals(this.fee, capitalBalance.fee) && + Objects.equals(this.principal, capitalBalance.principal) && + Objects.equals(this.total, capitalBalance.total); + } + + @Override + public int hashCode() { + return Objects.hash(currency, fee, principal, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CapitalBalance {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" principal: ").append(toIndentedString(principal)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("currency"); + openapiFields.add("fee"); + openapiFields.add("principal"); + openapiFields.add("total"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("currency"); + openapiRequiredFields.add("fee"); + openapiRequiredFields.add("principal"); + openapiRequiredFields.add("total"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CapitalBalance + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CapitalBalance.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CapitalBalance is not found in the empty JSON string", CapitalBalance.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CapitalBalance.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CapitalBalance` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CapitalBalance.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field currency + if (jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CapitalBalance.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CapitalBalance' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CapitalBalance.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CapitalBalance value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CapitalBalance read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CapitalBalance given an JSON string + * + * @param jsonString JSON string + * @return An instance of CapitalBalance + * @throws IOException if the JSON string is invalid with respect to CapitalBalance + */ + public static CapitalBalance fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CapitalBalance.class); + } + + /** + * Convert an instance of CapitalBalance to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/capital/CapitalGrant.java b/src/main/java/com/adyen/model/capital/CapitalGrant.java new file mode 100644 index 000000000..747763c3d --- /dev/null +++ b/src/main/java/com/adyen/model/capital/CapitalGrant.java @@ -0,0 +1,542 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.capital.Amount; +import com.adyen.model.capital.CapitalBalance; +import com.adyen.model.capital.Counterparty; +import com.adyen.model.capital.Fee; +import com.adyen.model.capital.Repayment; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.capital.JSON; + +/** + * CapitalGrant + */ + +public class CapitalGrant { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; + + public static final String SERIALIZED_NAME_BALANCES = "balances"; + @SerializedName(SERIALIZED_NAME_BALANCES) + private CapitalBalance balances; + + public static final String SERIALIZED_NAME_COUNTERPARTY = "counterparty"; + @SerializedName(SERIALIZED_NAME_COUNTERPARTY) + private Counterparty counterparty; + + public static final String SERIALIZED_NAME_FEE = "fee"; + @SerializedName(SERIALIZED_NAME_FEE) + private Fee fee; + + public static final String SERIALIZED_NAME_GRANT_ACCOUNT_ID = "grantAccountId"; + @SerializedName(SERIALIZED_NAME_GRANT_ACCOUNT_ID) + private String grantAccountId; + + public static final String SERIALIZED_NAME_GRANT_OFFER_ID = "grantOfferId"; + @SerializedName(SERIALIZED_NAME_GRANT_OFFER_ID) + private String grantOfferId; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_REPAYMENT = "repayment"; + @SerializedName(SERIALIZED_NAME_REPAYMENT) + private Repayment repayment; + + /** + * The current status of the grant. Possible values: **Pending**, **Active**, **Repaid**. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + PENDING("Pending"), + + ACTIVE("Active"), + + REPAID("Repaid"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public CapitalGrant() { + } + + public CapitalGrant amount(Amount amount) { + + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + **/ + @ApiModelProperty(value = "") + + public Amount getAmount() { + return amount; + } + + + public void setAmount(Amount amount) { + this.amount = amount; + } + + + public CapitalGrant balances(CapitalBalance balances) { + + this.balances = balances; + return this; + } + + /** + * Get balances + * @return balances + **/ + @ApiModelProperty(required = true, value = "") + + public CapitalBalance getBalances() { + return balances; + } + + + public void setBalances(CapitalBalance balances) { + this.balances = balances; + } + + + public CapitalGrant counterparty(Counterparty counterparty) { + + this.counterparty = counterparty; + return this; + } + + /** + * Get counterparty + * @return counterparty + **/ + @ApiModelProperty(value = "") + + public Counterparty getCounterparty() { + return counterparty; + } + + + public void setCounterparty(Counterparty counterparty) { + this.counterparty = counterparty; + } + + + public CapitalGrant fee(Fee fee) { + + this.fee = fee; + return this; + } + + /** + * Get fee + * @return fee + **/ + @ApiModelProperty(value = "") + + public Fee getFee() { + return fee; + } + + + public void setFee(Fee fee) { + this.fee = fee; + } + + + public CapitalGrant grantAccountId(String grantAccountId) { + + this.grantAccountId = grantAccountId; + return this; + } + + /** + * The identifier of the grant account used for the grant. + * @return grantAccountId + **/ + @ApiModelProperty(required = true, value = "The identifier of the grant account used for the grant.") + + public String getGrantAccountId() { + return grantAccountId; + } + + + public void setGrantAccountId(String grantAccountId) { + this.grantAccountId = grantAccountId; + } + + + public CapitalGrant grantOfferId(String grantOfferId) { + + this.grantOfferId = grantOfferId; + return this; + } + + /** + * The identifier of the grant offer that has been selected and from which the grant details will be used. + * @return grantOfferId + **/ + @ApiModelProperty(required = true, value = "The identifier of the grant offer that has been selected and from which the grant details will be used.") + + public String getGrantOfferId() { + return grantOfferId; + } + + + public void setGrantOfferId(String grantOfferId) { + this.grantOfferId = grantOfferId; + } + + + public CapitalGrant id(String id) { + + this.id = id; + return this; + } + + /** + * The identifier of the grant reference. + * @return id + **/ + @ApiModelProperty(required = true, value = "The identifier of the grant reference.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public CapitalGrant repayment(Repayment repayment) { + + this.repayment = repayment; + return this; + } + + /** + * Get repayment + * @return repayment + **/ + @ApiModelProperty(value = "") + + public Repayment getRepayment() { + return repayment; + } + + + public void setRepayment(Repayment repayment) { + this.repayment = repayment; + } + + + public CapitalGrant status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The current status of the grant. Possible values: **Pending**, **Active**, **Repaid**. + * @return status + **/ + @ApiModelProperty(required = true, value = "The current status of the grant. Possible values: **Pending**, **Active**, **Repaid**.") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CapitalGrant capitalGrant = (CapitalGrant) o; + return Objects.equals(this.amount, capitalGrant.amount) && + Objects.equals(this.balances, capitalGrant.balances) && + Objects.equals(this.counterparty, capitalGrant.counterparty) && + Objects.equals(this.fee, capitalGrant.fee) && + Objects.equals(this.grantAccountId, capitalGrant.grantAccountId) && + Objects.equals(this.grantOfferId, capitalGrant.grantOfferId) && + Objects.equals(this.id, capitalGrant.id) && + Objects.equals(this.repayment, capitalGrant.repayment) && + Objects.equals(this.status, capitalGrant.status); + } + + @Override + public int hashCode() { + return Objects.hash(amount, balances, counterparty, fee, grantAccountId, grantOfferId, id, repayment, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CapitalGrant {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" balances: ").append(toIndentedString(balances)).append("\n"); + sb.append(" counterparty: ").append(toIndentedString(counterparty)).append("\n"); + sb.append(" fee: ").append(toIndentedString(fee)).append("\n"); + sb.append(" grantAccountId: ").append(toIndentedString(grantAccountId)).append("\n"); + sb.append(" grantOfferId: ").append(toIndentedString(grantOfferId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" repayment: ").append(toIndentedString(repayment)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("amount"); + openapiFields.add("balances"); + openapiFields.add("counterparty"); + openapiFields.add("fee"); + openapiFields.add("grantAccountId"); + openapiFields.add("grantOfferId"); + openapiFields.add("id"); + openapiFields.add("repayment"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("balances"); + openapiRequiredFields.add("grantAccountId"); + openapiRequiredFields.add("grantOfferId"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("status"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CapitalGrant + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CapitalGrant.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CapitalGrant is not found in the empty JSON string", CapitalGrant.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CapitalGrant.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CapitalGrant` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CapitalGrant.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + // validate the optional field `balances` + if (jsonObj.getAsJsonObject("balances") != null) { + CapitalBalance.validateJsonObject(jsonObj.getAsJsonObject("balances")); + } + // validate the optional field `counterparty` + if (jsonObj.getAsJsonObject("counterparty") != null) { + Counterparty.validateJsonObject(jsonObj.getAsJsonObject("counterparty")); + } + // validate the optional field `fee` + if (jsonObj.getAsJsonObject("fee") != null) { + Fee.validateJsonObject(jsonObj.getAsJsonObject("fee")); + } + // validate the optional field grantAccountId + if (jsonObj.get("grantAccountId") != null && !jsonObj.get("grantAccountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `grantAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grantAccountId").toString())); + } + // validate the optional field grantOfferId + if (jsonObj.get("grantOfferId") != null && !jsonObj.get("grantOfferId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `grantOfferId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grantOfferId").toString())); + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field `repayment` + if (jsonObj.getAsJsonObject("repayment") != null) { + Repayment.validateJsonObject(jsonObj.getAsJsonObject("repayment")); + } + // ensure the field status can be parsed to an enum value + if (jsonObj.get("status") != null) { + if(!jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); + } + StatusEnum.fromValue(jsonObj.get("status").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CapitalGrant.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CapitalGrant' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CapitalGrant.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CapitalGrant value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CapitalGrant read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CapitalGrant given an JSON string + * + * @param jsonString JSON string + * @return An instance of CapitalGrant + * @throws IOException if the JSON string is invalid with respect to CapitalGrant + */ + public static CapitalGrant fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CapitalGrant.class); + } + + /** + * Convert an instance of CapitalGrant to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/capital/CapitalGrantInfo.java b/src/main/java/com/adyen/model/capital/CapitalGrantInfo.java new file mode 100644 index 000000000..2860d2995 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/CapitalGrantInfo.java @@ -0,0 +1,285 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.capital.Counterparty; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.capital.JSON; + +/** + * CapitalGrantInfo + */ + +public class CapitalGrantInfo { + public static final String SERIALIZED_NAME_COUNTERPARTY = "counterparty"; + @SerializedName(SERIALIZED_NAME_COUNTERPARTY) + private Counterparty counterparty; + + public static final String SERIALIZED_NAME_GRANT_ACCOUNT_ID = "grantAccountId"; + @SerializedName(SERIALIZED_NAME_GRANT_ACCOUNT_ID) + private String grantAccountId; + + public static final String SERIALIZED_NAME_GRANT_OFFER_ID = "grantOfferId"; + @SerializedName(SERIALIZED_NAME_GRANT_OFFER_ID) + private String grantOfferId; + + public CapitalGrantInfo() { + } + + public CapitalGrantInfo counterparty(Counterparty counterparty) { + + this.counterparty = counterparty; + return this; + } + + /** + * Get counterparty + * @return counterparty + **/ + @ApiModelProperty(value = "") + + public Counterparty getCounterparty() { + return counterparty; + } + + + public void setCounterparty(Counterparty counterparty) { + this.counterparty = counterparty; + } + + + public CapitalGrantInfo grantAccountId(String grantAccountId) { + + this.grantAccountId = grantAccountId; + return this; + } + + /** + * The identifier of the grant account used for the grant. + * @return grantAccountId + **/ + @ApiModelProperty(required = true, value = "The identifier of the grant account used for the grant.") + + public String getGrantAccountId() { + return grantAccountId; + } + + + public void setGrantAccountId(String grantAccountId) { + this.grantAccountId = grantAccountId; + } + + + public CapitalGrantInfo grantOfferId(String grantOfferId) { + + this.grantOfferId = grantOfferId; + return this; + } + + /** + * The identifier of the grant offer that has been selected and from which the grant details will be used. + * @return grantOfferId + **/ + @ApiModelProperty(required = true, value = "The identifier of the grant offer that has been selected and from which the grant details will be used.") + + public String getGrantOfferId() { + return grantOfferId; + } + + + public void setGrantOfferId(String grantOfferId) { + this.grantOfferId = grantOfferId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CapitalGrantInfo capitalGrantInfo = (CapitalGrantInfo) o; + return Objects.equals(this.counterparty, capitalGrantInfo.counterparty) && + Objects.equals(this.grantAccountId, capitalGrantInfo.grantAccountId) && + Objects.equals(this.grantOfferId, capitalGrantInfo.grantOfferId); + } + + @Override + public int hashCode() { + return Objects.hash(counterparty, grantAccountId, grantOfferId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CapitalGrantInfo {\n"); + sb.append(" counterparty: ").append(toIndentedString(counterparty)).append("\n"); + sb.append(" grantAccountId: ").append(toIndentedString(grantAccountId)).append("\n"); + sb.append(" grantOfferId: ").append(toIndentedString(grantOfferId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("counterparty"); + openapiFields.add("grantAccountId"); + openapiFields.add("grantOfferId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("grantAccountId"); + openapiRequiredFields.add("grantOfferId"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CapitalGrantInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CapitalGrantInfo.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CapitalGrantInfo is not found in the empty JSON string", CapitalGrantInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CapitalGrantInfo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CapitalGrantInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CapitalGrantInfo.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `counterparty` + if (jsonObj.getAsJsonObject("counterparty") != null) { + Counterparty.validateJsonObject(jsonObj.getAsJsonObject("counterparty")); + } + // validate the optional field grantAccountId + if (jsonObj.get("grantAccountId") != null && !jsonObj.get("grantAccountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `grantAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grantAccountId").toString())); + } + // validate the optional field grantOfferId + if (jsonObj.get("grantOfferId") != null && !jsonObj.get("grantOfferId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `grantOfferId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grantOfferId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CapitalGrantInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CapitalGrantInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CapitalGrantInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CapitalGrantInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CapitalGrantInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CapitalGrantInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of CapitalGrantInfo + * @throws IOException if the JSON string is invalid with respect to CapitalGrantInfo + */ + public static CapitalGrantInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CapitalGrantInfo.class); + } + + /** + * Convert an instance of CapitalGrantInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/capital/CapitalGrants.java b/src/main/java/com/adyen/model/capital/CapitalGrants.java new file mode 100644 index 000000000..6b0f0ff08 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/CapitalGrants.java @@ -0,0 +1,233 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.capital.CapitalGrant; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.capital.JSON; + +/** + * CapitalGrants + */ + +public class CapitalGrants { + public static final String SERIALIZED_NAME_GRANTS = "grants"; + @SerializedName(SERIALIZED_NAME_GRANTS) + private List grants = new ArrayList<>(); + + public CapitalGrants() { + } + + public CapitalGrants grants(List grants) { + + this.grants = grants; + return this; + } + + public CapitalGrants addGrantsItem(CapitalGrant grantsItem) { + this.grants.add(grantsItem); + return this; + } + + /** + * The unique identifier of the grant. + * @return grants + **/ + @ApiModelProperty(required = true, value = "The unique identifier of the grant.") + + public List getGrants() { + return grants; + } + + + public void setGrants(List grants) { + this.grants = grants; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CapitalGrants capitalGrants = (CapitalGrants) o; + return Objects.equals(this.grants, capitalGrants.grants); + } + + @Override + public int hashCode() { + return Objects.hash(grants); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CapitalGrants {\n"); + sb.append(" grants: ").append(toIndentedString(grants)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("grants"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("grants"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CapitalGrants + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CapitalGrants.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CapitalGrants is not found in the empty JSON string", CapitalGrants.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CapitalGrants.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CapitalGrants` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CapitalGrants.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + JsonArray jsonArraygrants = jsonObj.getAsJsonArray("grants"); + if (jsonArraygrants != null) { + // ensure the json data is an array + if (!jsonObj.get("grants").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `grants` to be an array in the JSON string but got `%s`", jsonObj.get("grants").toString())); + } + + // validate the optional field `grants` (array) + for (int i = 0; i < jsonArraygrants.size(); i++) { + CapitalGrant.validateJsonObject(jsonArraygrants.get(i).getAsJsonObject()); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CapitalGrants.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CapitalGrants' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CapitalGrants.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CapitalGrants value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CapitalGrants read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CapitalGrants given an JSON string + * + * @param jsonString JSON string + * @return An instance of CapitalGrants + * @throws IOException if the JSON string is invalid with respect to CapitalGrants + */ + public static CapitalGrants fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CapitalGrants.class); + } + + /** + * Convert an instance of CapitalGrants to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/capital/Counterparty.java b/src/main/java/com/adyen/model/capital/Counterparty.java new file mode 100644 index 000000000..8fe2b76d7 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/Counterparty.java @@ -0,0 +1,275 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.capital.JSON; + +/** + * Counterparty + */ + +public class Counterparty { + public static final String SERIALIZED_NAME_ACCOUNT_HOLDER_ID = "accountHolderId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_HOLDER_ID) + private String accountHolderId; + + public static final String SERIALIZED_NAME_BALANCE_ACCOUNT_ID = "balanceAccountId"; + @SerializedName(SERIALIZED_NAME_BALANCE_ACCOUNT_ID) + private String balanceAccountId; + + public static final String SERIALIZED_NAME_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; + @SerializedName(SERIALIZED_NAME_TRANSFER_INSTRUMENT_ID) + private String transferInstrumentId; + + public Counterparty() { + } + + public Counterparty accountHolderId(String accountHolderId) { + + this.accountHolderId = accountHolderId; + return this; + } + + /** + * The identifier of the receiving account holder. The payout will default to the primary balance account of this account holder if no `balanceAccountId` is provided. + * @return accountHolderId + **/ + @ApiModelProperty(value = "The identifier of the receiving account holder. The payout will default to the primary balance account of this account holder if no `balanceAccountId` is provided.") + + public String getAccountHolderId() { + return accountHolderId; + } + + + public void setAccountHolderId(String accountHolderId) { + this.accountHolderId = accountHolderId; + } + + + public Counterparty balanceAccountId(String balanceAccountId) { + + this.balanceAccountId = balanceAccountId; + return this; + } + + /** + * The identifier of the balance account that belongs to the receiving account holder. + * @return balanceAccountId + **/ + @ApiModelProperty(value = "The identifier of the balance account that belongs to the receiving account holder.") + + public String getBalanceAccountId() { + return balanceAccountId; + } + + + public void setBalanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + } + + + public Counterparty transferInstrumentId(String transferInstrumentId) { + + this.transferInstrumentId = transferInstrumentId; + return this; + } + + /** + * The identifier of the transfer instrument that belongs to the legal entity of the account holder. + * @return transferInstrumentId + **/ + @ApiModelProperty(value = "The identifier of the transfer instrument that belongs to the legal entity of the account holder.") + + public String getTransferInstrumentId() { + return transferInstrumentId; + } + + + public void setTransferInstrumentId(String transferInstrumentId) { + this.transferInstrumentId = transferInstrumentId; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Counterparty counterparty = (Counterparty) o; + return Objects.equals(this.accountHolderId, counterparty.accountHolderId) && + Objects.equals(this.balanceAccountId, counterparty.balanceAccountId) && + Objects.equals(this.transferInstrumentId, counterparty.transferInstrumentId); + } + + @Override + public int hashCode() { + return Objects.hash(accountHolderId, balanceAccountId, transferInstrumentId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Counterparty {\n"); + sb.append(" accountHolderId: ").append(toIndentedString(accountHolderId)).append("\n"); + sb.append(" balanceAccountId: ").append(toIndentedString(balanceAccountId)).append("\n"); + sb.append(" transferInstrumentId: ").append(toIndentedString(transferInstrumentId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("accountHolderId"); + openapiFields.add("balanceAccountId"); + openapiFields.add("transferInstrumentId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Counterparty + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Counterparty.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Counterparty is not found in the empty JSON string", Counterparty.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Counterparty.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Counterparty` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field accountHolderId + if (jsonObj.get("accountHolderId") != null && !jsonObj.get("accountHolderId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `accountHolderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountHolderId").toString())); + } + // validate the optional field balanceAccountId + if (jsonObj.get("balanceAccountId") != null && !jsonObj.get("balanceAccountId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); + } + // validate the optional field transferInstrumentId + if (jsonObj.get("transferInstrumentId") != null && !jsonObj.get("transferInstrumentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `transferInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferInstrumentId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Counterparty.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Counterparty' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Counterparty.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Counterparty value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Counterparty read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Counterparty given an JSON string + * + * @param jsonString JSON string + * @return An instance of Counterparty + * @throws IOException if the JSON string is invalid with respect to Counterparty + */ + public static Counterparty fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Counterparty.class); + } + + /** + * Convert an instance of Counterparty to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/capital/Fee.java b/src/main/java/com/adyen/model/capital/Fee.java new file mode 100644 index 000000000..4b31478c0 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/Fee.java @@ -0,0 +1,218 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.capital.Amount; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.capital.JSON; + +/** + * Fee + */ + +public class Fee { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; + + public Fee() { + } + + public Fee amount(Amount amount) { + + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + **/ + @ApiModelProperty(required = true, value = "") + + public Amount getAmount() { + return amount; + } + + + public void setAmount(Amount amount) { + this.amount = amount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Fee fee = (Fee) o; + return Objects.equals(this.amount, fee.amount); + } + + @Override + public int hashCode() { + return Objects.hash(amount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Fee {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("amount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("amount"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Fee + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Fee.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Fee is not found in the empty JSON string", Fee.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Fee.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Fee` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Fee.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Fee.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Fee' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Fee.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Fee value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Fee read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Fee given an JSON string + * + * @param jsonString JSON string + * @return An instance of Fee + * @throws IOException if the JSON string is invalid with respect to Fee + */ + public static Fee fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Fee.class); + } + + /** + * Convert an instance of Fee to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/capital/InvalidField.java b/src/main/java/com/adyen/model/capital/InvalidField.java new file mode 100644 index 000000000..60a2cf06f --- /dev/null +++ b/src/main/java/com/adyen/model/capital/InvalidField.java @@ -0,0 +1,285 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.capital.JSON; + +/** + * InvalidField + */ + +public class InvalidField { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + private String message; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private String value; + + public InvalidField() { + } + + public InvalidField message(String message) { + + this.message = message; + return this; + } + + /** + * Description of the validation error. + * @return message + **/ + @ApiModelProperty(required = true, value = "Description of the validation error.") + + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + public InvalidField name(String name) { + + this.name = name; + return this; + } + + /** + * The field that has an invalid value. + * @return name + **/ + @ApiModelProperty(required = true, value = "The field that has an invalid value.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public InvalidField value(String value) { + + this.value = value; + return this; + } + + /** + * The invalid value. + * @return value + **/ + @ApiModelProperty(required = true, value = "The invalid value.") + + public String getValue() { + return value; + } + + + public void setValue(String value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvalidField invalidField = (InvalidField) o; + return Objects.equals(this.message, invalidField.message) && + Objects.equals(this.name, invalidField.name) && + Objects.equals(this.value, invalidField.value); + } + + @Override + public int hashCode() { + return Objects.hash(message, name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvalidField {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("message"); + openapiFields.add("name"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("message"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("value"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvalidField + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (InvalidField.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in InvalidField is not found in the empty JSON string", InvalidField.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvalidField.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InvalidField` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : InvalidField.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field message + if (jsonObj.get("message") != null && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + // validate the optional field name + if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // validate the optional field value + if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvalidField.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvalidField' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvalidField.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvalidField value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvalidField read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvalidField given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvalidField + * @throws IOException if the JSON string is invalid with respect to InvalidField + */ + public static InvalidField fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvalidField.class); + } + + /** + * Convert an instance of InvalidField to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/capital/JSON.java b/src/main/java/com/adyen/model/capital/JSON.java new file mode 100644 index 000000000..534331c20 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/JSON.java @@ -0,0 +1,413 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import org.apache.commons.codec.binary.Base64; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.Amount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.CapitalBalance.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.CapitalGrant.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.CapitalGrantInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.CapitalGrants.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.Counterparty.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.Fee.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.InvalidField.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.JSONObject.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.JSONPath.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.Repayment.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.RepaymentTerm.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.RestServiceError.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.capital.ThresholdRepayment.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(new String(value)); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + return Base64.decodeBase64(bytesAsBase64); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/src/main/java/com/adyen/model/capital/JSONObject.java b/src/main/java/com/adyen/model/capital/JSONObject.java new file mode 100644 index 000000000..92ab1962a --- /dev/null +++ b/src/main/java/com/adyen/model/capital/JSONObject.java @@ -0,0 +1,261 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.capital.JSONPath; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.capital.JSON; + +/** + * JSONObject + */ + +public class JSONObject { + public static final String SERIALIZED_NAME_PATHS = "paths"; + @SerializedName(SERIALIZED_NAME_PATHS) + private List paths = null; + + public static final String SERIALIZED_NAME_ROOT_PATH = "rootPath"; + @SerializedName(SERIALIZED_NAME_ROOT_PATH) + private JSONPath rootPath; + + public JSONObject() { + } + + public JSONObject paths(List paths) { + + this.paths = paths; + return this; + } + + public JSONObject addPathsItem(JSONPath pathsItem) { + if (this.paths == null) { + this.paths = new ArrayList<>(); + } + this.paths.add(pathsItem); + return this; + } + + /** + * Get paths + * @return paths + **/ + @ApiModelProperty(value = "") + + public List getPaths() { + return paths; + } + + + public void setPaths(List paths) { + this.paths = paths; + } + + + public JSONObject rootPath(JSONPath rootPath) { + + this.rootPath = rootPath; + return this; + } + + /** + * Get rootPath + * @return rootPath + **/ + @ApiModelProperty(value = "") + + public JSONPath getRootPath() { + return rootPath; + } + + + public void setRootPath(JSONPath rootPath) { + this.rootPath = rootPath; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JSONObject jsONObject = (JSONObject) o; + return Objects.equals(this.paths, jsONObject.paths) && + Objects.equals(this.rootPath, jsONObject.rootPath); + } + + @Override + public int hashCode() { + return Objects.hash(paths, rootPath); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JSONObject {\n"); + sb.append(" paths: ").append(toIndentedString(paths)).append("\n"); + sb.append(" rootPath: ").append(toIndentedString(rootPath)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("paths"); + openapiFields.add("rootPath"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JSONObject + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JSONObject.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JSONObject is not found in the empty JSON string", JSONObject.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JSONObject.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JSONObject` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + JsonArray jsonArraypaths = jsonObj.getAsJsonArray("paths"); + if (jsonArraypaths != null) { + // ensure the json data is an array + if (!jsonObj.get("paths").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `paths` to be an array in the JSON string but got `%s`", jsonObj.get("paths").toString())); + } + + // validate the optional field `paths` (array) + for (int i = 0; i < jsonArraypaths.size(); i++) { + JSONPath.validateJsonObject(jsonArraypaths.get(i).getAsJsonObject()); + } + } + // validate the optional field `rootPath` + if (jsonObj.getAsJsonObject("rootPath") != null) { + JSONPath.validateJsonObject(jsonObj.getAsJsonObject("rootPath")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JSONObject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JSONObject' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JSONObject.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JSONObject value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JSONObject read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JSONObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of JSONObject + * @throws IOException if the JSON string is invalid with respect to JSONObject + */ + public static JSONObject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JSONObject.class); + } + + /** + * Convert an instance of JSONObject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/capital/JSONPath.java b/src/main/java/com/adyen/model/capital/JSONPath.java new file mode 100644 index 000000000..6bfdc008a --- /dev/null +++ b/src/main/java/com/adyen/model/capital/JSONPath.java @@ -0,0 +1,219 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.capital.JSON; + +/** + * JSONPath + */ + +public class JSONPath { + public static final String SERIALIZED_NAME_CONTENT = "content"; + @SerializedName(SERIALIZED_NAME_CONTENT) + private List content = null; + + public JSONPath() { + } + + public JSONPath content(List content) { + + this.content = content; + return this; + } + + public JSONPath addContentItem(String contentItem) { + if (this.content == null) { + this.content = new ArrayList<>(); + } + this.content.add(contentItem); + return this; + } + + /** + * Get content + * @return content + **/ + @ApiModelProperty(value = "") + + public List getContent() { + return content; + } + + + public void setContent(List content) { + this.content = content; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JSONPath jsONPath = (JSONPath) o; + return Objects.equals(this.content, jsONPath.content); + } + + @Override + public int hashCode() { + return Objects.hash(content); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JSONPath {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("content"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JSONPath + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JSONPath.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JSONPath is not found in the empty JSON string", JSONPath.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JSONPath.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `JSONPath` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // ensure the json data is an array + if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JSONPath.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JSONPath' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JSONPath.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JSONPath value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JSONPath read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JSONPath given an JSON string + * + * @param jsonString JSON string + * @return An instance of JSONPath + * @throws IOException if the JSON string is invalid with respect to JSONPath + */ + public static JSONPath fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JSONPath.class); + } + + /** + * Convert an instance of JSONPath to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/capital/Repayment.java b/src/main/java/com/adyen/model/capital/Repayment.java new file mode 100644 index 000000000..22d4f9ed3 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/Repayment.java @@ -0,0 +1,281 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.capital.RepaymentTerm; +import com.adyen.model.capital.ThresholdRepayment; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.capital.JSON; + +/** + * Repayment + */ + +public class Repayment { + public static final String SERIALIZED_NAME_BASIS_POINTS = "basisPoints"; + @SerializedName(SERIALIZED_NAME_BASIS_POINTS) + private Integer basisPoints; + + public static final String SERIALIZED_NAME_TERM = "term"; + @SerializedName(SERIALIZED_NAME_TERM) + private RepaymentTerm term; + + public static final String SERIALIZED_NAME_THRESHOLD = "threshold"; + @SerializedName(SERIALIZED_NAME_THRESHOLD) + private ThresholdRepayment threshold; + + public Repayment() { + } + + public Repayment basisPoints(Integer basisPoints) { + + this.basisPoints = basisPoints; + return this; + } + + /** + * The repayment that is deducted daily from incoming net volume, in [basis points](https://www.investopedia.com/terms/b/basispoint.asp). + * @return basisPoints + **/ + @ApiModelProperty(required = true, value = "The repayment that is deducted daily from incoming net volume, in [basis points](https://www.investopedia.com/terms/b/basispoint.asp).") + + public Integer getBasisPoints() { + return basisPoints; + } + + + public void setBasisPoints(Integer basisPoints) { + this.basisPoints = basisPoints; + } + + + public Repayment term(RepaymentTerm term) { + + this.term = term; + return this; + } + + /** + * Get term + * @return term + **/ + @ApiModelProperty(value = "") + + public RepaymentTerm getTerm() { + return term; + } + + + public void setTerm(RepaymentTerm term) { + this.term = term; + } + + + public Repayment threshold(ThresholdRepayment threshold) { + + this.threshold = threshold; + return this; + } + + /** + * Get threshold + * @return threshold + **/ + @ApiModelProperty(value = "") + + public ThresholdRepayment getThreshold() { + return threshold; + } + + + public void setThreshold(ThresholdRepayment threshold) { + this.threshold = threshold; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Repayment repayment = (Repayment) o; + return Objects.equals(this.basisPoints, repayment.basisPoints) && + Objects.equals(this.term, repayment.term) && + Objects.equals(this.threshold, repayment.threshold); + } + + @Override + public int hashCode() { + return Objects.hash(basisPoints, term, threshold); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Repayment {\n"); + sb.append(" basisPoints: ").append(toIndentedString(basisPoints)).append("\n"); + sb.append(" term: ").append(toIndentedString(term)).append("\n"); + sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("basisPoints"); + openapiFields.add("term"); + openapiFields.add("threshold"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("basisPoints"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Repayment + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Repayment.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Repayment is not found in the empty JSON string", Repayment.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Repayment.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Repayment` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Repayment.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `term` + if (jsonObj.getAsJsonObject("term") != null) { + RepaymentTerm.validateJsonObject(jsonObj.getAsJsonObject("term")); + } + // validate the optional field `threshold` + if (jsonObj.getAsJsonObject("threshold") != null) { + ThresholdRepayment.validateJsonObject(jsonObj.getAsJsonObject("threshold")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Repayment.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Repayment' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Repayment.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Repayment value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Repayment read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Repayment given an JSON string + * + * @param jsonString JSON string + * @return An instance of Repayment + * @throws IOException if the JSON string is invalid with respect to Repayment + */ + public static Repayment fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Repayment.class); + } + + /** + * Convert an instance of Repayment to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/capital/RepaymentTerm.java b/src/main/java/com/adyen/model/capital/RepaymentTerm.java new file mode 100644 index 000000000..8a77b59b1 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/RepaymentTerm.java @@ -0,0 +1,242 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.capital.JSON; + +/** + * RepaymentTerm + */ + +public class RepaymentTerm { + public static final String SERIALIZED_NAME_ESTIMATED_DAYS = "estimatedDays"; + @SerializedName(SERIALIZED_NAME_ESTIMATED_DAYS) + private Integer estimatedDays; + + public static final String SERIALIZED_NAME_MAXIMUM_DAYS = "maximumDays"; + @SerializedName(SERIALIZED_NAME_MAXIMUM_DAYS) + private Integer maximumDays; + + public RepaymentTerm() { + } + + public RepaymentTerm estimatedDays(Integer estimatedDays) { + + this.estimatedDays = estimatedDays; + return this; + } + + /** + * The estimated term for repaying the grant, in days. + * @return estimatedDays + **/ + @ApiModelProperty(required = true, value = "The estimated term for repaying the grant, in days.") + + public Integer getEstimatedDays() { + return estimatedDays; + } + + + public void setEstimatedDays(Integer estimatedDays) { + this.estimatedDays = estimatedDays; + } + + + public RepaymentTerm maximumDays(Integer maximumDays) { + + this.maximumDays = maximumDays; + return this; + } + + /** + * The maximum term for repaying the grant, in days. Only applies when `contractType` is **loan**. + * @return maximumDays + **/ + @ApiModelProperty(value = "The maximum term for repaying the grant, in days. Only applies when `contractType` is **loan**.") + + public Integer getMaximumDays() { + return maximumDays; + } + + + public void setMaximumDays(Integer maximumDays) { + this.maximumDays = maximumDays; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RepaymentTerm repaymentTerm = (RepaymentTerm) o; + return Objects.equals(this.estimatedDays, repaymentTerm.estimatedDays) && + Objects.equals(this.maximumDays, repaymentTerm.maximumDays); + } + + @Override + public int hashCode() { + return Objects.hash(estimatedDays, maximumDays); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RepaymentTerm {\n"); + sb.append(" estimatedDays: ").append(toIndentedString(estimatedDays)).append("\n"); + sb.append(" maximumDays: ").append(toIndentedString(maximumDays)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("estimatedDays"); + openapiFields.add("maximumDays"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("estimatedDays"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RepaymentTerm + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (RepaymentTerm.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in RepaymentTerm is not found in the empty JSON string", RepaymentTerm.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RepaymentTerm.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RepaymentTerm` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RepaymentTerm.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RepaymentTerm.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RepaymentTerm' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RepaymentTerm.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RepaymentTerm value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RepaymentTerm read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RepaymentTerm given an JSON string + * + * @param jsonString JSON string + * @return An instance of RepaymentTerm + * @throws IOException if the JSON string is invalid with respect to RepaymentTerm + */ + public static RepaymentTerm fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RepaymentTerm.class); + } + + /** + * Convert an instance of RepaymentTerm to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/capital/RestServiceError.java b/src/main/java/com/adyen/model/capital/RestServiceError.java new file mode 100644 index 000000000..9c27cb36e --- /dev/null +++ b/src/main/java/com/adyen/model/capital/RestServiceError.java @@ -0,0 +1,501 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.capital.InvalidField; +import com.adyen.model.capital.JSONObject; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.capital.JSON; + +/** + * RestServiceError + */ + +public class RestServiceError { + public static final String SERIALIZED_NAME_DETAIL = "detail"; + @SerializedName(SERIALIZED_NAME_DETAIL) + private String detail; + + public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode"; + @SerializedName(SERIALIZED_NAME_ERROR_CODE) + private String errorCode; + + public static final String SERIALIZED_NAME_INSTANCE = "instance"; + @SerializedName(SERIALIZED_NAME_INSTANCE) + private String instance; + + public static final String SERIALIZED_NAME_INVALID_FIELDS = "invalidFields"; + @SerializedName(SERIALIZED_NAME_INVALID_FIELDS) + private List invalidFields = null; + + public static final String SERIALIZED_NAME_REQUEST_ID = "requestId"; + @SerializedName(SERIALIZED_NAME_REQUEST_ID) + private String requestId; + + public static final String SERIALIZED_NAME_RESPONSE = "response"; + @SerializedName(SERIALIZED_NAME_RESPONSE) + private JSONObject response; + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private Integer status; + + public static final String SERIALIZED_NAME_TITLE = "title"; + @SerializedName(SERIALIZED_NAME_TITLE) + private String title; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public RestServiceError() { + } + + public RestServiceError detail(String detail) { + + this.detail = detail; + return this; + } + + /** + * A human-readable explanation specific to this occurrence of the problem. + * @return detail + **/ + @ApiModelProperty(required = true, value = "A human-readable explanation specific to this occurrence of the problem.") + + public String getDetail() { + return detail; + } + + + public void setDetail(String detail) { + this.detail = detail; + } + + + public RestServiceError errorCode(String errorCode) { + + this.errorCode = errorCode; + return this; + } + + /** + * A code that identifies the problem type. + * @return errorCode + **/ + @ApiModelProperty(required = true, value = "A code that identifies the problem type.") + + public String getErrorCode() { + return errorCode; + } + + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + + public RestServiceError instance(String instance) { + + this.instance = instance; + return this; + } + + /** + * A unique URI that identifies the specific occurrence of the problem. + * @return instance + **/ + @ApiModelProperty(value = "A unique URI that identifies the specific occurrence of the problem.") + + public String getInstance() { + return instance; + } + + + public void setInstance(String instance) { + this.instance = instance; + } + + + public RestServiceError invalidFields(List invalidFields) { + + this.invalidFields = invalidFields; + return this; + } + + public RestServiceError addInvalidFieldsItem(InvalidField invalidFieldsItem) { + if (this.invalidFields == null) { + this.invalidFields = new ArrayList<>(); + } + this.invalidFields.add(invalidFieldsItem); + return this; + } + + /** + * Detailed explanation of each validation error, when applicable. + * @return invalidFields + **/ + @ApiModelProperty(value = "Detailed explanation of each validation error, when applicable.") + + public List getInvalidFields() { + return invalidFields; + } + + + public void setInvalidFields(List invalidFields) { + this.invalidFields = invalidFields; + } + + + public RestServiceError requestId(String requestId) { + + this.requestId = requestId; + return this; + } + + /** + * A unique reference for the request, essentially the same as `pspReference`. + * @return requestId + **/ + @ApiModelProperty(value = "A unique reference for the request, essentially the same as `pspReference`.") + + public String getRequestId() { + return requestId; + } + + + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + + public RestServiceError response(JSONObject response) { + + this.response = response; + return this; + } + + /** + * Get response + * @return response + **/ + @ApiModelProperty(value = "") + + public JSONObject getResponse() { + return response; + } + + + public void setResponse(JSONObject response) { + this.response = response; + } + + + public RestServiceError status(Integer status) { + + this.status = status; + return this; + } + + /** + * The HTTP status code. + * @return status + **/ + @ApiModelProperty(required = true, value = "The HTTP status code.") + + public Integer getStatus() { + return status; + } + + + public void setStatus(Integer status) { + this.status = status; + } + + + public RestServiceError title(String title) { + + this.title = title; + return this; + } + + /** + * A short, human-readable summary of the problem type. + * @return title + **/ + @ApiModelProperty(required = true, value = "A short, human-readable summary of the problem type.") + + public String getTitle() { + return title; + } + + + public void setTitle(String title) { + this.title = title; + } + + + public RestServiceError type(String type) { + + this.type = type; + return this; + } + + /** + * A URI that identifies the problem type, pointing to human-readable documentation on this problem type. + * @return type + **/ + @ApiModelProperty(required = true, value = "A URI that identifies the problem type, pointing to human-readable documentation on this problem type.") + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestServiceError restServiceError = (RestServiceError) o; + return Objects.equals(this.detail, restServiceError.detail) && + Objects.equals(this.errorCode, restServiceError.errorCode) && + Objects.equals(this.instance, restServiceError.instance) && + Objects.equals(this.invalidFields, restServiceError.invalidFields) && + Objects.equals(this.requestId, restServiceError.requestId) && + Objects.equals(this.response, restServiceError.response) && + Objects.equals(this.status, restServiceError.status) && + Objects.equals(this.title, restServiceError.title) && + Objects.equals(this.type, restServiceError.type); + } + + @Override + public int hashCode() { + return Objects.hash(detail, errorCode, instance, invalidFields, requestId, response, status, title, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestServiceError {\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" invalidFields: ").append(toIndentedString(invalidFields)).append("\n"); + sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("detail"); + openapiFields.add("errorCode"); + openapiFields.add("instance"); + openapiFields.add("invalidFields"); + openapiFields.add("requestId"); + openapiFields.add("response"); + openapiFields.add("status"); + openapiFields.add("title"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("detail"); + openapiRequiredFields.add("errorCode"); + openapiRequiredFields.add("status"); + openapiRequiredFields.add("title"); + openapiRequiredFields.add("type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RestServiceError + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (RestServiceError.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in RestServiceError is not found in the empty JSON string", RestServiceError.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RestServiceError.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RestServiceError` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RestServiceError.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field detail + if (jsonObj.get("detail") != null && !jsonObj.get("detail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `detail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detail").toString())); + } + // validate the optional field errorCode + if (jsonObj.get("errorCode") != null && !jsonObj.get("errorCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); + } + // validate the optional field instance + if (jsonObj.get("instance") != null && !jsonObj.get("instance").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `instance` to be a primitive type in the JSON string but got `%s`", jsonObj.get("instance").toString())); + } + JsonArray jsonArrayinvalidFields = jsonObj.getAsJsonArray("invalidFields"); + if (jsonArrayinvalidFields != null) { + // ensure the json data is an array + if (!jsonObj.get("invalidFields").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `invalidFields` to be an array in the JSON string but got `%s`", jsonObj.get("invalidFields").toString())); + } + + // validate the optional field `invalidFields` (array) + for (int i = 0; i < jsonArrayinvalidFields.size(); i++) { + InvalidField.validateJsonObject(jsonArrayinvalidFields.get(i).getAsJsonObject()); + } + } + // validate the optional field requestId + if (jsonObj.get("requestId") != null && !jsonObj.get("requestId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `requestId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestId").toString())); + } + // validate the optional field `response` + if (jsonObj.getAsJsonObject("response") != null) { + JSONObject.validateJsonObject(jsonObj.getAsJsonObject("response")); + } + // validate the optional field title + if (jsonObj.get("title") != null && !jsonObj.get("title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); + } + // validate the optional field type + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!RestServiceError.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RestServiceError' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RestServiceError.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RestServiceError value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RestServiceError read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RestServiceError given an JSON string + * + * @param jsonString JSON string + * @return An instance of RestServiceError + * @throws IOException if the JSON string is invalid with respect to RestServiceError + */ + public static RestServiceError fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RestServiceError.class); + } + + /** + * Convert an instance of RestServiceError to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/capital/ThresholdRepayment.java b/src/main/java/com/adyen/model/capital/ThresholdRepayment.java new file mode 100644 index 000000000..06e58a494 --- /dev/null +++ b/src/main/java/com/adyen/model/capital/ThresholdRepayment.java @@ -0,0 +1,218 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.capital; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.capital.Amount; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.adyen.model.capital.JSON; + +/** + * ThresholdRepayment + */ + +public class ThresholdRepayment { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; + + public ThresholdRepayment() { + } + + public ThresholdRepayment amount(Amount amount) { + + this.amount = amount; + return this; + } + + /** + * Get amount + * @return amount + **/ + @ApiModelProperty(required = true, value = "") + + public Amount getAmount() { + return amount; + } + + + public void setAmount(Amount amount) { + this.amount = amount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ThresholdRepayment thresholdRepayment = (ThresholdRepayment) o; + return Objects.equals(this.amount, thresholdRepayment.amount); + } + + @Override + public int hashCode() { + return Objects.hash(amount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ThresholdRepayment {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("amount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("amount"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ThresholdRepayment + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ThresholdRepayment.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ThresholdRepayment is not found in the empty JSON string", ThresholdRepayment.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ThresholdRepayment.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThresholdRepayment` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ThresholdRepayment.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ThresholdRepayment.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ThresholdRepayment' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ThresholdRepayment.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ThresholdRepayment value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ThresholdRepayment read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ThresholdRepayment given an JSON string + * + * @param jsonString JSON string + * @return An instance of ThresholdRepayment + * @throws IOException if the JSON string is invalid with respect to ThresholdRepayment + */ + public static ThresholdRepayment fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ThresholdRepayment.class); + } + + /** + * Convert an instance of ThresholdRepayment to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/checkout/AccountInfo.java b/src/main/java/com/adyen/model/checkout/AccountInfo.java index dc4026b75..1057b6350 100644 --- a/src/main/java/com/adyen/model/checkout/AccountInfo.java +++ b/src/main/java/com/adyen/model/checkout/AccountInfo.java @@ -286,10 +286,12 @@ public DeliveryAddressUsageIndicatorEnum read(final JsonReader jsonReader) throw private DeliveryAddressUsageIndicatorEnum deliveryAddressUsageIndicator; public static final String SERIALIZED_NAME_HOME_PHONE = "homePhone"; + @Deprecated @SerializedName(SERIALIZED_NAME_HOME_PHONE) private String homePhone; public static final String SERIALIZED_NAME_MOBILE_PHONE = "mobilePhone"; + @Deprecated @SerializedName(SERIALIZED_NAME_MOBILE_PHONE) private String mobilePhone; @@ -432,6 +434,7 @@ public PaymentAccountIndicatorEnum read(final JsonReader jsonReader) throws IOEx private Boolean suspiciousActivity; public static final String SERIALIZED_NAME_WORK_PHONE = "workPhone"; + @Deprecated @SerializedName(SERIALIZED_NAME_WORK_PHONE) private String workPhone; @@ -614,6 +617,7 @@ public void setDeliveryAddressUsageIndicator(DeliveryAddressUsageIndicatorEnum d } + @Deprecated public AccountInfo homePhone(String homePhone) { this.homePhone = homePhone; @@ -633,11 +637,13 @@ public String getHomePhone() { } + @Deprecated public void setHomePhone(String homePhone) { this.homePhone = homePhone; } + @Deprecated public AccountInfo mobilePhone(String mobilePhone) { this.mobilePhone = mobilePhone; @@ -657,6 +663,7 @@ public String getMobilePhone() { } + @Deprecated public void setMobilePhone(String mobilePhone) { this.mobilePhone = mobilePhone; } @@ -838,6 +845,7 @@ public void setSuspiciousActivity(Boolean suspiciousActivity) { } + @Deprecated public AccountInfo workPhone(String workPhone) { this.workPhone = workPhone; @@ -857,6 +865,7 @@ public String getWorkPhone() { } + @Deprecated public void setWorkPhone(String workPhone) { this.workPhone = workPhone; } diff --git a/src/main/java/com/adyen/model/checkout/AchDetails.java b/src/main/java/com/adyen/model/checkout/AchDetails.java index 487623129..9806198be 100644 --- a/src/main/java/com/adyen/model/checkout/AchDetails.java +++ b/src/main/java/com/adyen/model/checkout/AchDetails.java @@ -73,6 +73,7 @@ public class AchDetails { private String ownerName; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -266,6 +267,7 @@ public void setOwnerName(String ownerName) { } + @Deprecated public AchDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -285,6 +287,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalData3DSecure.java b/src/main/java/com/adyen/model/checkout/AdditionalData3DSecure.java index d2a21b0eb..19fc234d1 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalData3DSecure.java @@ -49,6 +49,7 @@ public class AdditionalData3DSecure { public static final String SERIALIZED_NAME_ALLOW3_D_S2 = "allow3DS2"; + @Deprecated @SerializedName(SERIALIZED_NAME_ALLOW3_D_S2) private String allow3DS2; @@ -110,6 +111,7 @@ public ChallengeWindowSizeEnum read(final JsonReader jsonReader) throws IOExcept private ChallengeWindowSizeEnum challengeWindowSize; public static final String SERIALIZED_NAME_EXECUTE_THREE_D = "executeThreeD"; + @Deprecated @SerializedName(SERIALIZED_NAME_EXECUTE_THREE_D) private String executeThreeD; @@ -128,6 +130,7 @@ public ChallengeWindowSizeEnum read(final JsonReader jsonReader) throws IOExcept public AdditionalData3DSecure() { } + @Deprecated public AdditionalData3DSecure allow3DS2(String allow3DS2) { this.allow3DS2 = allow3DS2; @@ -147,6 +150,7 @@ public String getAllow3DS2() { } + @Deprecated public void setAllow3DS2(String allow3DS2) { this.allow3DS2 = allow3DS2; } @@ -174,6 +178,7 @@ public void setChallengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) } + @Deprecated public AdditionalData3DSecure executeThreeD(String executeThreeD) { this.executeThreeD = executeThreeD; @@ -193,6 +198,7 @@ public String getExecuteThreeD() { } + @Deprecated public void setExecuteThreeD(String executeThreeD) { this.executeThreeD = executeThreeD; } diff --git a/src/main/java/com/adyen/model/checkout/AfterpayDetails.java b/src/main/java/com/adyen/model/checkout/AfterpayDetails.java index e755bfaf3..d9701e2b2 100644 --- a/src/main/java/com/adyen/model/checkout/AfterpayDetails.java +++ b/src/main/java/com/adyen/model/checkout/AfterpayDetails.java @@ -65,6 +65,7 @@ public class AfterpayDetails { private String personalDetails; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -216,6 +217,7 @@ public void setPersonalDetails(String personalDetails) { } + @Deprecated public AfterpayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -235,6 +237,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/ApplePayDetails.java b/src/main/java/com/adyen/model/checkout/ApplePayDetails.java index 80d52d42e..fef11b65c 100644 --- a/src/main/java/com/adyen/model/checkout/ApplePayDetails.java +++ b/src/main/java/com/adyen/model/checkout/ApplePayDetails.java @@ -106,6 +106,7 @@ public FundingSourceEnum read(final JsonReader jsonReader) throws IOException { private FundingSourceEnum fundingSource; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -231,6 +232,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { } + @Deprecated public ApplePayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -250,6 +252,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java b/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java index 1124eb720..bb4c9c437 100644 --- a/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java +++ b/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java @@ -65,6 +65,7 @@ public class BacsDirectDebitDetails { private String holderName; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -212,6 +213,7 @@ public void setHolderName(String holderName) { } + @Deprecated public BacsDirectDebitDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -231,6 +233,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/BlikDetails.java b/src/main/java/com/adyen/model/checkout/BlikDetails.java index 25151d852..cc16d8f7f 100644 --- a/src/main/java/com/adyen/model/checkout/BlikDetails.java +++ b/src/main/java/com/adyen/model/checkout/BlikDetails.java @@ -57,6 +57,7 @@ public class BlikDetails { private String checkoutAttemptId; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -160,6 +161,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { } + @Deprecated public BlikDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -179,6 +181,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/CardDetails.java b/src/main/java/com/adyen/model/checkout/CardDetails.java index c6f738cac..37dd3ddb8 100644 --- a/src/main/java/com/adyen/model/checkout/CardDetails.java +++ b/src/main/java/com/adyen/model/checkout/CardDetails.java @@ -57,6 +57,7 @@ public class CardDetails { private String checkoutAttemptId; public static final String SERIALIZED_NAME_CUPSECUREPLUS_SMSCODE = "cupsecureplus.smscode"; + @Deprecated @SerializedName(SERIALIZED_NAME_CUPSECUREPLUS_SMSCODE) private String cupsecureplusSmscode; @@ -150,6 +151,7 @@ public FundingSourceEnum read(final JsonReader jsonReader) throws IOException { private String number; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -269,6 +271,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { } + @Deprecated public CardDetails cupsecureplusSmscode(String cupsecureplusSmscode) { this.cupsecureplusSmscode = cupsecureplusSmscode; @@ -288,6 +291,7 @@ public String getCupsecureplusSmscode() { } + @Deprecated public void setCupsecureplusSmscode(String cupsecureplusSmscode) { this.cupsecureplusSmscode = cupsecureplusSmscode; } @@ -535,6 +539,7 @@ public void setNumber(String number) { } + @Deprecated public CardDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -554,6 +559,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java b/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java index 985f6369f..114cd5575 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java @@ -331,6 +331,7 @@ public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOExcepti private ThreeDS2RequestData threeDS2RequestData; public static final String SERIALIZED_NAME_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; + @Deprecated @SerializedName(SERIALIZED_NAME_THREE_D_S_AUTHENTICATION_ONLY) private Boolean threeDSAuthenticationOnly = false; @@ -1284,6 +1285,7 @@ public void setThreeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { } + @Deprecated public CheckoutBalanceCheckRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; @@ -1303,6 +1305,7 @@ public Boolean getThreeDSAuthenticationOnly() { } + @Deprecated public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; } diff --git a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java index f7d65cb15..31adea4e5 100644 --- a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java @@ -476,6 +476,7 @@ public StorePaymentMethodModeEnum read(final JsonReader jsonReader) throws IOExc private String telephoneNumber; public static final String SERIALIZED_NAME_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; + @Deprecated @SerializedName(SERIALIZED_NAME_THREE_D_S_AUTHENTICATION_ONLY) private Boolean threeDSAuthenticationOnly = false; @@ -1686,6 +1687,7 @@ public void setTelephoneNumber(String telephoneNumber) { } + @Deprecated public CreateCheckoutSessionRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; @@ -1705,6 +1707,7 @@ public Boolean getThreeDSAuthenticationOnly() { } + @Deprecated public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; } diff --git a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java index cdc8f203d..bf41c447d 100644 --- a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java +++ b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java @@ -535,6 +535,7 @@ public StorePaymentMethodModeEnum read(final JsonReader jsonReader) throws IOExc private String telephoneNumber; public static final String SERIALIZED_NAME_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; + @Deprecated @SerializedName(SERIALIZED_NAME_THREE_D_S_AUTHENTICATION_ONLY) private Boolean threeDSAuthenticationOnly = false; @@ -1810,6 +1811,7 @@ public void setTelephoneNumber(String telephoneNumber) { } + @Deprecated public CreateCheckoutSessionResponse threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; @@ -1829,6 +1831,7 @@ public Boolean getThreeDSAuthenticationOnly() { } + @Deprecated public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; } diff --git a/src/main/java/com/adyen/model/checkout/DetailsRequest.java b/src/main/java/com/adyen/model/checkout/DetailsRequest.java index 81bc28735..c216ec83b 100644 --- a/src/main/java/com/adyen/model/checkout/DetailsRequest.java +++ b/src/main/java/com/adyen/model/checkout/DetailsRequest.java @@ -63,6 +63,7 @@ public class DetailsRequest { private String paymentData; public static final String SERIALIZED_NAME_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; + @Deprecated @SerializedName(SERIALIZED_NAME_THREE_D_S_AUTHENTICATION_ONLY) private Boolean threeDSAuthenticationOnly; @@ -135,6 +136,7 @@ public void setPaymentData(String paymentData) { } + @Deprecated public DetailsRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; @@ -154,6 +156,7 @@ public Boolean getThreeDSAuthenticationOnly() { } + @Deprecated public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; } diff --git a/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java b/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java index 9ecc03b3c..7bfddabba 100644 --- a/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java +++ b/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java @@ -57,6 +57,7 @@ public class GenericIssuerPaymentMethodDetails { private String issuer; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -166,6 +167,7 @@ public void setIssuer(String issuer) { } + @Deprecated public GenericIssuerPaymentMethodDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -185,6 +187,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/GiropayDetails.java b/src/main/java/com/adyen/model/checkout/GiropayDetails.java index 0f0342fbc..62179d33d 100644 --- a/src/main/java/com/adyen/model/checkout/GiropayDetails.java +++ b/src/main/java/com/adyen/model/checkout/GiropayDetails.java @@ -53,6 +53,7 @@ public class GiropayDetails { private String checkoutAttemptId; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -134,6 +135,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { } + @Deprecated public GiropayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -153,6 +155,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/GooglePayDetails.java b/src/main/java/com/adyen/model/checkout/GooglePayDetails.java index e8af6a771..d2c6dc454 100644 --- a/src/main/java/com/adyen/model/checkout/GooglePayDetails.java +++ b/src/main/java/com/adyen/model/checkout/GooglePayDetails.java @@ -106,6 +106,7 @@ public FundingSourceEnum read(final JsonReader jsonReader) throws IOException { private String googlePayToken; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -231,6 +232,7 @@ public void setGooglePayToken(String googlePayToken) { } + @Deprecated public GooglePayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -250,6 +252,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/IdealDetails.java b/src/main/java/com/adyen/model/checkout/IdealDetails.java index 49ba90237..d66cdcaa5 100644 --- a/src/main/java/com/adyen/model/checkout/IdealDetails.java +++ b/src/main/java/com/adyen/model/checkout/IdealDetails.java @@ -57,6 +57,7 @@ public class IdealDetails { private String issuer; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -160,6 +161,7 @@ public void setIssuer(String issuer) { } + @Deprecated public IdealDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -179,6 +181,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/InputDetail.java b/src/main/java/com/adyen/model/checkout/InputDetail.java index 01aedcd45..736855565 100644 --- a/src/main/java/com/adyen/model/checkout/InputDetail.java +++ b/src/main/java/com/adyen/model/checkout/InputDetail.java @@ -63,6 +63,7 @@ public class InputDetail { private List details = null; public static final String SERIALIZED_NAME_INPUT_DETAILS = "inputDetails"; + @Deprecated @SerializedName(SERIALIZED_NAME_INPUT_DETAILS) private List inputDetails = null; @@ -153,6 +154,7 @@ public void setDetails(List details) { } + @Deprecated public InputDetail inputDetails(List inputDetails) { this.inputDetails = inputDetails; @@ -180,6 +182,7 @@ public List getInputDetails() { } + @Deprecated public void setInputDetails(List inputDetails) { this.inputDetails = inputDetails; } diff --git a/src/main/java/com/adyen/model/checkout/KlarnaDetails.java b/src/main/java/com/adyen/model/checkout/KlarnaDetails.java index 3568eaa3e..d60911f97 100644 --- a/src/main/java/com/adyen/model/checkout/KlarnaDetails.java +++ b/src/main/java/com/adyen/model/checkout/KlarnaDetails.java @@ -65,6 +65,7 @@ public class KlarnaDetails { private String personalDetails; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -224,6 +225,7 @@ public void setPersonalDetails(String personalDetails) { } + @Deprecated public KlarnaDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -243,6 +245,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/MerchantRiskIndicator.java b/src/main/java/com/adyen/model/checkout/MerchantRiskIndicator.java index 89e69ae30..54234f7e4 100644 --- a/src/main/java/com/adyen/model/checkout/MerchantRiskIndicator.java +++ b/src/main/java/com/adyen/model/checkout/MerchantRiskIndicator.java @@ -116,6 +116,7 @@ public DeliveryAddressIndicatorEnum read(final JsonReader jsonReader) throws IOE private DeliveryAddressIndicatorEnum deliveryAddressIndicator; public static final String SERIALIZED_NAME_DELIVERY_EMAIL = "deliveryEmail"; + @Deprecated @SerializedName(SERIALIZED_NAME_DELIVERY_EMAIL) private String deliveryEmail; @@ -261,6 +262,7 @@ public void setDeliveryAddressIndicator(DeliveryAddressIndicatorEnum deliveryAdd } + @Deprecated public MerchantRiskIndicator deliveryEmail(String deliveryEmail) { this.deliveryEmail = deliveryEmail; @@ -280,6 +282,7 @@ public String getDeliveryEmail() { } + @Deprecated public void setDeliveryEmail(String deliveryEmail) { this.deliveryEmail = deliveryEmail; } diff --git a/src/main/java/com/adyen/model/checkout/OpenInvoiceDetails.java b/src/main/java/com/adyen/model/checkout/OpenInvoiceDetails.java index 9fcbd35e2..a060c7335 100644 --- a/src/main/java/com/adyen/model/checkout/OpenInvoiceDetails.java +++ b/src/main/java/com/adyen/model/checkout/OpenInvoiceDetails.java @@ -65,6 +65,7 @@ public class OpenInvoiceDetails { private String personalDetails; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -216,6 +217,7 @@ public void setPersonalDetails(String personalDetails) { } + @Deprecated public OpenInvoiceDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -235,6 +237,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/PayPalDetails.java b/src/main/java/com/adyen/model/checkout/PayPalDetails.java index 644ab7033..eb9ef5cf5 100644 --- a/src/main/java/com/adyen/model/checkout/PayPalDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayPalDetails.java @@ -61,6 +61,7 @@ public class PayPalDetails { private String payerID; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -237,6 +238,7 @@ public void setPayerID(String payerID) { } + @Deprecated public PayPalDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -256,6 +258,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java b/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java index 0b50cec85..e97732875 100644 --- a/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java @@ -53,6 +53,7 @@ public class PayUUpiDetails { private String checkoutAttemptId; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -142,6 +143,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { } + @Deprecated public PayUUpiDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -161,6 +163,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java b/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java index 37c4b674d..47d8cd1e5 100644 --- a/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java @@ -106,6 +106,7 @@ public FundingSourceEnum read(final JsonReader jsonReader) throws IOException { private String googlePayToken; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -231,6 +232,7 @@ public void setGooglePayToken(String googlePayToken) { } + @Deprecated public PayWithGoogleDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -250,6 +252,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java b/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java index 1c219e736..0768d7db6 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java @@ -172,6 +172,7 @@ public ChannelEnum read(final JsonReader jsonReader) throws IOException { private Company company; public static final String SERIALIZED_NAME_CONVERSION_ID = "conversionId"; + @Deprecated @SerializedName(SERIALIZED_NAME_CONVERSION_ID) private String conversionId; @@ -580,6 +581,7 @@ public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOExcepti private ThreeDS2RequestData threeDS2RequestData; public static final String SERIALIZED_NAME_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; + @Deprecated @SerializedName(SERIALIZED_NAME_THREE_D_S_AUTHENTICATION_ONLY) private Boolean threeDSAuthenticationOnly = false; @@ -862,6 +864,7 @@ public void setCompany(Company company) { } + @Deprecated public PaymentDonationRequest conversionId(String conversionId) { this.conversionId = conversionId; @@ -881,6 +884,7 @@ public String getConversionId() { } + @Deprecated public void setConversionId(String conversionId) { this.conversionId = conversionId; } @@ -2062,6 +2066,7 @@ public void setThreeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { } + @Deprecated public PaymentDonationRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; @@ -2081,6 +2086,7 @@ public Boolean getThreeDSAuthenticationOnly() { } + @Deprecated public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; } diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethod.java b/src/main/java/com/adyen/model/checkout/PaymentMethod.java index f810ad671..001c2281c 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethod.java @@ -121,6 +121,7 @@ public FundingSourceEnum read(final JsonReader jsonReader) throws IOException { private PaymentMethodGroup group; public static final String SERIALIZED_NAME_INPUT_DETAILS = "inputDetails"; + @Deprecated @SerializedName(SERIALIZED_NAME_INPUT_DETAILS) private List inputDetails = null; @@ -265,6 +266,7 @@ public void setGroup(PaymentMethodGroup group) { } + @Deprecated public PaymentMethod inputDetails(List inputDetails) { this.inputDetails = inputDetails; @@ -292,6 +294,7 @@ public List getInputDetails() { } + @Deprecated public void setInputDetails(List inputDetails) { this.inputDetails = inputDetails; } diff --git a/src/main/java/com/adyen/model/checkout/PaymentRequest.java b/src/main/java/com/adyen/model/checkout/PaymentRequest.java index e599f2aa7..b7bc0cdd4 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentRequest.java @@ -172,6 +172,7 @@ public ChannelEnum read(final JsonReader jsonReader) throws IOException { private Company company; public static final String SERIALIZED_NAME_CONVERSION_ID = "conversionId"; + @Deprecated @SerializedName(SERIALIZED_NAME_CONVERSION_ID) private String conversionId; @@ -568,6 +569,7 @@ public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOExcepti private ThreeDS2RequestData threeDS2RequestData; public static final String SERIALIZED_NAME_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; + @Deprecated @SerializedName(SERIALIZED_NAME_THREE_D_S_AUTHENTICATION_ONLY) private Boolean threeDSAuthenticationOnly = false; @@ -850,6 +852,7 @@ public void setCompany(Company company) { } + @Deprecated public PaymentRequest conversionId(String conversionId) { this.conversionId = conversionId; @@ -869,6 +872,7 @@ public String getConversionId() { } + @Deprecated public void setConversionId(String conversionId) { this.conversionId = conversionId; } @@ -1984,6 +1988,7 @@ public void setThreeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { } + @Deprecated public PaymentRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; @@ -2003,6 +2008,7 @@ public Boolean getThreeDSAuthenticationOnly() { } + @Deprecated public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; } diff --git a/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java b/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java index f3a9dd05f..7f0c52cbd 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java @@ -165,6 +165,7 @@ public ChannelEnum read(final JsonReader jsonReader) throws IOException { private ModelConfiguration configuration; public static final String SERIALIZED_NAME_CONVERSION_ID = "conversionId"; + @Deprecated @SerializedName(SERIALIZED_NAME_CONVERSION_ID) private String conversionId; @@ -427,6 +428,7 @@ public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOExcepti private String telephoneNumber; public static final String SERIALIZED_NAME_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; + @Deprecated @SerializedName(SERIALIZED_NAME_THREE_D_S_AUTHENTICATION_ONLY) private Boolean threeDSAuthenticationOnly = false; @@ -729,6 +731,7 @@ public void setConfiguration(ModelConfiguration configuration) { } + @Deprecated public PaymentSetupRequest conversionId(String conversionId) { this.conversionId = conversionId; @@ -748,6 +751,7 @@ public String getConversionId() { } + @Deprecated public void setConversionId(String conversionId) { this.conversionId = conversionId; } @@ -1665,6 +1669,7 @@ public void setTelephoneNumber(String telephoneNumber) { } + @Deprecated public PaymentSetupRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; @@ -1684,6 +1689,7 @@ public Boolean getThreeDSAuthenticationOnly() { } + @Deprecated public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; } diff --git a/src/main/java/com/adyen/model/checkout/PaymentSetupResponse.java b/src/main/java/com/adyen/model/checkout/PaymentSetupResponse.java index cf48c1c9e..61ff3e057 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentSetupResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentSetupResponse.java @@ -56,6 +56,7 @@ public class PaymentSetupResponse { private String paymentSession; public static final String SERIALIZED_NAME_RECURRING_DETAILS = "recurringDetails"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAILS) private List recurringDetails = null; @@ -84,6 +85,7 @@ public void setPaymentSession(String paymentSession) { } + @Deprecated public PaymentSetupResponse recurringDetails(List recurringDetails) { this.recurringDetails = recurringDetails; @@ -111,6 +113,7 @@ public List getRecurringDetails() { } + @Deprecated public void setRecurringDetails(List recurringDetails) { this.recurringDetails = recurringDetails; } diff --git a/src/main/java/com/adyen/model/checkout/RatepayDetails.java b/src/main/java/com/adyen/model/checkout/RatepayDetails.java index f8ab6084a..85911dd27 100644 --- a/src/main/java/com/adyen/model/checkout/RatepayDetails.java +++ b/src/main/java/com/adyen/model/checkout/RatepayDetails.java @@ -65,6 +65,7 @@ public class RatepayDetails { private String personalDetails; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -214,6 +215,7 @@ public void setPersonalDetails(String personalDetails) { } + @Deprecated public RatepayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -233,6 +235,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/RecurringDetail.java b/src/main/java/com/adyen/model/checkout/RecurringDetail.java index 02144644c..1be1615d2 100644 --- a/src/main/java/com/adyen/model/checkout/RecurringDetail.java +++ b/src/main/java/com/adyen/model/checkout/RecurringDetail.java @@ -122,6 +122,7 @@ public FundingSourceEnum read(final JsonReader jsonReader) throws IOException { private PaymentMethodGroup group; public static final String SERIALIZED_NAME_INPUT_DETAILS = "inputDetails"; + @Deprecated @SerializedName(SERIALIZED_NAME_INPUT_DETAILS) private List inputDetails = null; @@ -274,6 +275,7 @@ public void setGroup(PaymentMethodGroup group) { } + @Deprecated public RecurringDetail inputDetails(List inputDetails) { this.inputDetails = inputDetails; @@ -301,6 +303,7 @@ public List getInputDetails() { } + @Deprecated public void setInputDetails(List inputDetails) { this.inputDetails = inputDetails; } diff --git a/src/main/java/com/adyen/model/checkout/SamsungPayDetails.java b/src/main/java/com/adyen/model/checkout/SamsungPayDetails.java index 00e9bc04e..d2b0aab72 100644 --- a/src/main/java/com/adyen/model/checkout/SamsungPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/SamsungPayDetails.java @@ -102,6 +102,7 @@ public FundingSourceEnum read(final JsonReader jsonReader) throws IOException { private FundingSourceEnum fundingSource; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -209,6 +210,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { } + @Deprecated public SamsungPayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -228,6 +230,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/SepaDirectDebitDetails.java b/src/main/java/com/adyen/model/checkout/SepaDirectDebitDetails.java index 1f507253b..c66b879d1 100644 --- a/src/main/java/com/adyen/model/checkout/SepaDirectDebitDetails.java +++ b/src/main/java/com/adyen/model/checkout/SepaDirectDebitDetails.java @@ -61,6 +61,7 @@ public class SepaDirectDebitDetails { private String ownerName; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -188,6 +189,7 @@ public void setOwnerName(String ownerName) { } + @Deprecated public SepaDirectDebitDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -207,6 +209,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java index af3720d32..1e76e774d 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java @@ -53,6 +53,7 @@ public class StoredPaymentMethodDetails { private String checkoutAttemptId; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -168,6 +169,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { } + @Deprecated public StoredPaymentMethodDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -187,6 +189,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java b/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java index 1b228b57a..3740a6922 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java @@ -171,6 +171,7 @@ public AddrMatchEnum read(final JsonReader jsonReader) throws IOException { private AddrMatchEnum addrMatch; public static final String SERIALIZED_NAME_AUTHENTICATION_ONLY = "authenticationOnly"; + @Deprecated @SerializedName(SERIALIZED_NAME_AUTHENTICATION_ONLY) private Boolean authenticationOnly = false; @@ -226,6 +227,7 @@ public ChallengeIndicatorEnum read(final JsonReader jsonReader) throws IOExcepti } public static final String SERIALIZED_NAME_CHALLENGE_INDICATOR = "challengeIndicator"; + @Deprecated @SerializedName(SERIALIZED_NAME_CHALLENGE_INDICATOR) private ChallengeIndicatorEnum challengeIndicator; @@ -631,6 +633,7 @@ public void setAddrMatch(AddrMatchEnum addrMatch) { } + @Deprecated public ThreeDS2RequestData authenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; @@ -650,11 +653,13 @@ public Boolean getAuthenticationOnly() { } + @Deprecated public void setAuthenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; } + @Deprecated public ThreeDS2RequestData challengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; @@ -674,6 +679,7 @@ public ChallengeIndicatorEnum getChallengeIndicator() { } + @Deprecated public void setChallengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; } diff --git a/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java b/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java index 795d39f35..8d5a1aff3 100644 --- a/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java +++ b/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java @@ -57,6 +57,7 @@ public class UpiCollectDetails { private String checkoutAttemptId; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -168,6 +169,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { } + @Deprecated public UpiCollectDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -187,6 +189,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java b/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java index 4bd31dbf3..e6f728a64 100644 --- a/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java +++ b/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java @@ -53,6 +53,7 @@ public class UpiIntentDetails { private String checkoutAttemptId; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -138,6 +139,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { } + @Deprecated public UpiIntentDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -157,6 +159,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/VippsDetails.java b/src/main/java/com/adyen/model/checkout/VippsDetails.java index c2e296000..2de55da0d 100644 --- a/src/main/java/com/adyen/model/checkout/VippsDetails.java +++ b/src/main/java/com/adyen/model/checkout/VippsDetails.java @@ -53,6 +53,7 @@ public class VippsDetails { private String checkoutAttemptId; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -138,6 +139,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { } + @Deprecated public VippsDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -157,6 +159,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/checkout/ZipDetails.java b/src/main/java/com/adyen/model/checkout/ZipDetails.java index 5e39136d9..c404100b9 100644 --- a/src/main/java/com/adyen/model/checkout/ZipDetails.java +++ b/src/main/java/com/adyen/model/checkout/ZipDetails.java @@ -57,6 +57,7 @@ public class ZipDetails { private String clickAndCollect; public static final String SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + @Deprecated @SerializedName(SERIALIZED_NAME_RECURRING_DETAIL_REFERENCE) private String recurringDetailReference; @@ -162,6 +163,7 @@ public void setClickAndCollect(String clickAndCollect) { } + @Deprecated public ZipDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; @@ -181,6 +183,7 @@ public String getRecurringDetailReference() { } + @Deprecated public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Address.java b/src/main/java/com/adyen/model/legalentitymanagement/Address.java index e01364a9f..3fda8e412 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Address.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Address.java @@ -148,10 +148,10 @@ public Address stateOrProvince(String stateOrProvince) { } /** - * The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`. + * The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`. * @return stateOrProvince **/ - @ApiModelProperty(value = "The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`.") + @ApiModelProperty(value = "The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`.") public String getStateOrProvince() { return stateOrProvince; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java b/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java index b907e9ace..7de79e7ae 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java @@ -53,10 +53,12 @@ public class Attachment { private byte[] content; public static final String SERIALIZED_NAME_CONTENT_TYPE = "contentType"; + @Deprecated @SerializedName(SERIALIZED_NAME_CONTENT_TYPE) private String contentType; public static final String SERIALIZED_NAME_FILENAME = "filename"; + @Deprecated @SerializedName(SERIALIZED_NAME_FILENAME) private String filename; @@ -93,6 +95,7 @@ public void setContent(byte[] content) { } + @Deprecated public Attachment contentType(String contentType) { this.contentType = contentType; @@ -112,11 +115,13 @@ public String getContentType() { } + @Deprecated public void setContentType(String contentType) { this.contentType = contentType; } + @Deprecated public Attachment filename(String filename) { this.filename = filename; @@ -136,6 +141,7 @@ public String getFilename() { } + @Deprecated public void setFilename(String filename) { this.filename = filename; } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java index 645d432c1..c836a8e68 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java @@ -54,6 +54,7 @@ public class BankAccountInfo { private BankAccountInfoAccountIdentification accountIdentification; public static final String SERIALIZED_NAME_ACCOUNT_TYPE = "accountType"; + @Deprecated @SerializedName(SERIALIZED_NAME_ACCOUNT_TYPE) private String accountType; @@ -86,6 +87,7 @@ public void setAccountIdentification(BankAccountInfoAccountIdentification accoun } + @Deprecated public BankAccountInfo accountType(String accountType) { this.accountType = accountType; @@ -105,6 +107,7 @@ public String getAccountType() { } + @Deprecated public void setAccountType(String accountType) { this.accountType = accountType; } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java index 173541abc..813a647f9 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java @@ -55,6 +55,7 @@ public class BusinessLine { public static final String SERIALIZED_NAME_CAPABILITY = "capability"; + @Deprecated @SerializedName(SERIALIZED_NAME_CAPABILITY) private String capability; @@ -154,6 +155,7 @@ public BusinessLine( this.id = id; } + @Deprecated public BusinessLine capability(String capability) { this.capability = capability; @@ -173,6 +175,7 @@ public String getCapability() { } + @Deprecated public void setCapability(String capability) { this.capability = capability; } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java index dd2c611e6..15f1e214e 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java @@ -54,6 +54,7 @@ public class BusinessLineInfo { public static final String SERIALIZED_NAME_CAPABILITY = "capability"; + @Deprecated @SerializedName(SERIALIZED_NAME_CAPABILITY) private String capability; @@ -137,6 +138,7 @@ public ServiceEnum read(final JsonReader jsonReader) throws IOException { public BusinessLineInfo() { } + @Deprecated public BusinessLineInfo capability(String capability) { this.capability = capability; @@ -156,6 +158,7 @@ public String getCapability() { } + @Deprecated public void setCapability(String capability) { this.capability = capability; } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java index 0ae540474..6f89b4c8c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java @@ -54,6 +54,7 @@ public class BusinessLineInfoUpdate { public static final String SERIALIZED_NAME_CAPABILITY = "capability"; + @Deprecated @SerializedName(SERIALIZED_NAME_CAPABILITY) private String capability; @@ -137,6 +138,7 @@ public ServiceEnum read(final JsonReader jsonReader) throws IOException { public BusinessLineInfoUpdate() { } + @Deprecated public BusinessLineInfoUpdate capability(String capability) { this.capability = capability; @@ -156,6 +158,7 @@ public String getCapability() { } + @Deprecated public void setCapability(String capability) { this.capability = capability; } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Document.java b/src/main/java/com/adyen/model/legalentitymanagement/Document.java index 804912930..c9208b799 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Document.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Document.java @@ -70,6 +70,7 @@ public class Document { private String description; public static final String SERIALIZED_NAME_EXPIRY_DATE = "expiryDate"; + @Deprecated @SerializedName(SERIALIZED_NAME_EXPIRY_DATE) private String expiryDate; @@ -82,10 +83,12 @@ public class Document { private String id; public static final String SERIALIZED_NAME_ISSUER_COUNTRY = "issuerCountry"; + @Deprecated @SerializedName(SERIALIZED_NAME_ISSUER_COUNTRY) private String issuerCountry; public static final String SERIALIZED_NAME_ISSUER_STATE = "issuerState"; + @Deprecated @SerializedName(SERIALIZED_NAME_ISSUER_STATE) private String issuerState; @@ -102,7 +105,7 @@ public class Document { private OwnerEntity owner; /** - * Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -273,6 +276,7 @@ public void setDescription(String description) { } + @Deprecated public Document expiryDate(String expiryDate) { this.expiryDate = expiryDate; @@ -292,6 +296,7 @@ public String getExpiryDate() { } + @Deprecated public void setExpiryDate(String expiryDate) { this.expiryDate = expiryDate; } @@ -332,6 +337,7 @@ public String getId() { + @Deprecated public Document issuerCountry(String issuerCountry) { this.issuerCountry = issuerCountry; @@ -351,11 +357,13 @@ public String getIssuerCountry() { } + @Deprecated public void setIssuerCountry(String issuerCountry) { this.issuerCountry = issuerCountry; } + @Deprecated public Document issuerState(String issuerState) { this.issuerState = issuerState; @@ -375,6 +383,7 @@ public String getIssuerState() { } + @Deprecated public void setIssuerState(String issuerState) { this.issuerState = issuerState; } @@ -444,10 +453,10 @@ public Document type(TypeEnum type) { } /** - * Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). * @return type **/ - @ApiModelProperty(required = true, value = "Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id).") + @ApiModelProperty(required = true, value = "Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id).") public TypeEnum getType() { return type; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java b/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java index a260e9fee..9f1503f7e 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java @@ -53,10 +53,12 @@ public class IdentificationData { private String cardNumber; public static final String SERIALIZED_NAME_EXPIRY_DATE = "expiryDate"; + @Deprecated @SerializedName(SERIALIZED_NAME_EXPIRY_DATE) private String expiryDate; public static final String SERIALIZED_NAME_ISSUER_COUNTRY = "issuerCountry"; + @Deprecated @SerializedName(SERIALIZED_NAME_ISSUER_COUNTRY) private String issuerCountry; @@ -73,7 +75,7 @@ public class IdentificationData { private String number; /** - * Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -170,6 +172,7 @@ public void setCardNumber(String cardNumber) { } + @Deprecated public IdentificationData expiryDate(String expiryDate) { this.expiryDate = expiryDate; @@ -189,11 +192,13 @@ public String getExpiryDate() { } + @Deprecated public void setExpiryDate(String expiryDate) { this.expiryDate = expiryDate; } + @Deprecated public IdentificationData issuerCountry(String issuerCountry) { this.issuerCountry = issuerCountry; @@ -213,6 +218,7 @@ public String getIssuerCountry() { } + @Deprecated public void setIssuerCountry(String issuerCountry) { this.issuerCountry = issuerCountry; } @@ -291,10 +297,10 @@ public IdentificationData type(TypeEnum type) { } /** - * Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). * @return type **/ - @ApiModelProperty(required = true, value = "Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id).") + @ApiModelProperty(required = true, value = "Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. When providing ID numbers: * For **individual**, the `type` values can be **driversLicense**, **identityCard**, **nationalIdNumber**, or **passport**. When uploading photo IDs: * For **individual**, the `type` values can be **identityCard**, **driversLicense**, or **passport**. When uploading other documents: * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, or **proofOfIndustry**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, or **proofOfIndividualTaxId**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id).") public TypeEnum getType() { return type; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java index 19e220553..e4c825392 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java @@ -70,6 +70,7 @@ public class LegalEntity { private List documentDetails = null; public static final String SERIALIZED_NAME_DOCUMENTS = "documents"; + @Deprecated @SerializedName(SERIALIZED_NAME_DOCUMENTS) private List documents = null; @@ -220,6 +221,7 @@ public void setDocumentDetails(List documentDetails) { } + @Deprecated public LegalEntity documents(List documents) { this.documents = documents; @@ -247,6 +249,7 @@ public List getDocuments() { } + @Deprecated public void setDocuments(List documents) { this.documents = documents; } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java index 537c8fb7c..3f4c67021 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java @@ -69,7 +69,7 @@ public class LegalEntityAssociation { private String name; /** - * Defines the relationship of the legal entity to the current legal entity. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. + * Defines the relationship of the legal entity to the current legal entity. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -156,10 +156,10 @@ public String getAssociatorId() { /** - * The legal entity type of associated legal entity. For example, **organization**, **soleProprietorship** or **individual**. + * The legal entity type of associated legal entity. For example, **organization**, **soleProprietorship** or **individual**. * @return entityType **/ - @ApiModelProperty(value = "The legal entity type of associated legal entity. For example, **organization**, **soleProprietorship** or **individual**. ") + @ApiModelProperty(value = "The legal entity type of associated legal entity. For example, **organization**, **soleProprietorship** or **individual**.") public String getEntityType() { return entityType; @@ -232,10 +232,10 @@ public LegalEntityAssociation type(TypeEnum type) { } /** - * Defines the relationship of the legal entity to the current legal entity. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. + * Defines the relationship of the legal entity to the current legal entity. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. * @return type **/ - @ApiModelProperty(required = true, value = "Defines the relationship of the legal entity to the current legal entity. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**. ") + @ApiModelProperty(required = true, value = "Defines the relationship of the legal entity to the current legal entity. Possible values for organizations: **uboThroughOwnership**, **uboThroughControl**, **signatory**, or **ultimateParentCompany**. Possible values for sole proprietorships: **soleProprietorship**.") public TypeEnum getType() { return type; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Organization.java b/src/main/java/com/adyen/model/legalentitymanagement/Organization.java index 210657fc1..5f4bec67d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Organization.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Organization.java @@ -105,7 +105,7 @@ public class Organization { private TaxReportingClassification taxReportingClassification; /** - * Type of organization. Possible values: **associationIncorporated**, **governmentalOrganization**, **listedPublicCompany**, **nonProfit**, **partnershipIncorporated**, **privateCompany**. + * Type of organization. Possible values: **associationIncorporated**, **governmentalOrganization**, **listedPublicCompany**, **nonProfit**, **partnershipIncorporated**, **privateCompany**. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -504,10 +504,10 @@ public Organization type(TypeEnum type) { } /** - * Type of organization. Possible values: **associationIncorporated**, **governmentalOrganization**, **listedPublicCompany**, **nonProfit**, **partnershipIncorporated**, **privateCompany**. + * Type of organization. Possible values: **associationIncorporated**, **governmentalOrganization**, **listedPublicCompany**, **nonProfit**, **partnershipIncorporated**, **privateCompany**. * @return type **/ - @ApiModelProperty(value = "Type of organization. Possible values: **associationIncorporated**, **governmentalOrganization**, **listedPublicCompany**, **nonProfit**, **partnershipIncorporated**, **privateCompany**.") + @ApiModelProperty(value = "Type of organization. Possible values: **associationIncorporated**, **governmentalOrganization**, **listedPublicCompany**, **nonProfit**, **partnershipIncorporated**, **privateCompany**.") public TypeEnum getType() { return type; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java b/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java index 1cb74c144..ee801a586 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java @@ -49,6 +49,7 @@ public class SourceOfFunds { public static final String SERIALIZED_NAME_ACQUIRING_BUSINESS_LINE_ID = "acquiringBusinessLineId"; + @Deprecated @SerializedName(SERIALIZED_NAME_ACQUIRING_BUSINESS_LINE_ID) private String acquiringBusinessLineId; @@ -112,6 +113,7 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { public SourceOfFunds() { } + @Deprecated public SourceOfFunds acquiringBusinessLineId(String acquiringBusinessLineId) { this.acquiringBusinessLineId = acquiringBusinessLineId; @@ -131,6 +133,7 @@ public String getAcquiringBusinessLineId() { } + @Deprecated public void setAcquiringBusinessLineId(String acquiringBusinessLineId) { this.acquiringBusinessLineId = acquiringBusinessLineId; } diff --git a/src/main/java/com/adyen/model/management/Nexo.java b/src/main/java/com/adyen/model/management/Nexo.java index 1fedad413..16eb458f8 100644 --- a/src/main/java/com/adyen/model/management/Nexo.java +++ b/src/main/java/com/adyen/model/management/Nexo.java @@ -66,6 +66,7 @@ public class Nexo { private EventUrl eventUrls; public static final String SERIALIZED_NAME_NEXO_EVENT_URLS = "nexoEventUrls"; + @Deprecated @SerializedName(SERIALIZED_NAME_NEXO_EVENT_URLS) private List nexoEventUrls = null; @@ -138,6 +139,7 @@ public void setEventUrls(EventUrl eventUrls) { } + @Deprecated public Nexo nexoEventUrls(List nexoEventUrls) { this.nexoEventUrls = nexoEventUrls; @@ -165,6 +167,7 @@ public List getNexoEventUrls() { } + @Deprecated public void setNexoEventUrls(List nexoEventUrls) { this.nexoEventUrls = nexoEventUrls; } diff --git a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsResponse.java b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsResponse.java index 1e293ecc1..0026e62d2 100644 --- a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsResponse.java +++ b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsResponse.java @@ -71,6 +71,7 @@ public class ScheduleTerminalActionsResponse { private String storeId; public static final String SERIALIZED_NAME_TERMINAL_IDS = "terminalIds"; + @Deprecated @SerializedName(SERIALIZED_NAME_TERMINAL_IDS) private List terminalIds = null; @@ -185,6 +186,7 @@ public void setStoreId(String storeId) { } + @Deprecated public ScheduleTerminalActionsResponse terminalIds(List terminalIds) { this.terminalIds = terminalIds; @@ -212,6 +214,7 @@ public List getTerminalIds() { } + @Deprecated public void setTerminalIds(List terminalIds) { this.terminalIds = terminalIds; } diff --git a/src/main/java/com/adyen/model/payment/AccountInfo.java b/src/main/java/com/adyen/model/payment/AccountInfo.java index e218f8bea..75706a32f 100644 --- a/src/main/java/com/adyen/model/payment/AccountInfo.java +++ b/src/main/java/com/adyen/model/payment/AccountInfo.java @@ -287,10 +287,12 @@ public DeliveryAddressUsageIndicatorEnum read(final JsonReader jsonReader) throw private DeliveryAddressUsageIndicatorEnum deliveryAddressUsageIndicator; public static final String SERIALIZED_NAME_HOME_PHONE = "homePhone"; + @Deprecated @SerializedName(SERIALIZED_NAME_HOME_PHONE) private String homePhone; public static final String SERIALIZED_NAME_MOBILE_PHONE = "mobilePhone"; + @Deprecated @SerializedName(SERIALIZED_NAME_MOBILE_PHONE) private String mobilePhone; @@ -433,6 +435,7 @@ public PaymentAccountIndicatorEnum read(final JsonReader jsonReader) throws IOEx private Boolean suspiciousActivity; public static final String SERIALIZED_NAME_WORK_PHONE = "workPhone"; + @Deprecated @SerializedName(SERIALIZED_NAME_WORK_PHONE) private String workPhone; @@ -615,6 +618,7 @@ public void setDeliveryAddressUsageIndicator(DeliveryAddressUsageIndicatorEnum d } + @Deprecated public AccountInfo homePhone(String homePhone) { this.homePhone = homePhone; @@ -634,11 +638,13 @@ public String getHomePhone() { } + @Deprecated public void setHomePhone(String homePhone) { this.homePhone = homePhone; } + @Deprecated public AccountInfo mobilePhone(String mobilePhone) { this.mobilePhone = mobilePhone; @@ -658,6 +664,7 @@ public String getMobilePhone() { } + @Deprecated public void setMobilePhone(String mobilePhone) { this.mobilePhone = mobilePhone; } @@ -839,6 +846,7 @@ public void setSuspiciousActivity(Boolean suspiciousActivity) { } + @Deprecated public AccountInfo workPhone(String workPhone) { this.workPhone = workPhone; @@ -858,6 +866,7 @@ public String getWorkPhone() { } + @Deprecated public void setWorkPhone(String workPhone) { this.workPhone = workPhone; } diff --git a/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java b/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java index 57e9ad2c4..b79e3f436 100644 --- a/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java +++ b/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java @@ -117,6 +117,7 @@ public DeliveryAddressIndicatorEnum read(final JsonReader jsonReader) throws IOE private DeliveryAddressIndicatorEnum deliveryAddressIndicator; public static final String SERIALIZED_NAME_DELIVERY_EMAIL = "deliveryEmail"; + @Deprecated @SerializedName(SERIALIZED_NAME_DELIVERY_EMAIL) private String deliveryEmail; @@ -262,6 +263,7 @@ public void setDeliveryAddressIndicator(DeliveryAddressIndicatorEnum deliveryAdd } + @Deprecated public MerchantRiskIndicator deliveryEmail(String deliveryEmail) { this.deliveryEmail = deliveryEmail; @@ -281,6 +283,7 @@ public String getDeliveryEmail() { } + @Deprecated public void setDeliveryEmail(String deliveryEmail) { this.deliveryEmail = deliveryEmail; } diff --git a/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java b/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java index 23353310a..e9867963e 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java @@ -172,6 +172,7 @@ public AddrMatchEnum read(final JsonReader jsonReader) throws IOException { private AddrMatchEnum addrMatch; public static final String SERIALIZED_NAME_AUTHENTICATION_ONLY = "authenticationOnly"; + @Deprecated @SerializedName(SERIALIZED_NAME_AUTHENTICATION_ONLY) private Boolean authenticationOnly = false; @@ -227,6 +228,7 @@ public ChallengeIndicatorEnum read(final JsonReader jsonReader) throws IOExcepti } public static final String SERIALIZED_NAME_CHALLENGE_INDICATOR = "challengeIndicator"; + @Deprecated @SerializedName(SERIALIZED_NAME_CHALLENGE_INDICATOR) private ChallengeIndicatorEnum challengeIndicator; @@ -632,6 +634,7 @@ public void setAddrMatch(AddrMatchEnum addrMatch) { } + @Deprecated public ThreeDS2RequestData authenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; @@ -651,11 +654,13 @@ public Boolean getAuthenticationOnly() { } + @Deprecated public void setAuthenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; } + @Deprecated public ThreeDS2RequestData challengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; @@ -675,6 +680,7 @@ public ChallengeIndicatorEnum getChallengeIndicator() { } + @Deprecated public void setChallengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; } diff --git a/src/main/java/com/adyen/model/transfers/Transfer.java b/src/main/java/com/adyen/model/transfers/Transfer.java index c3c9ccc3d..7e1fd9f4b 100644 --- a/src/main/java/com/adyen/model/transfers/Transfer.java +++ b/src/main/java/com/adyen/model/transfers/Transfer.java @@ -65,6 +65,7 @@ public class Transfer { private ResourceReference balanceAccount; public static final String SERIALIZED_NAME_BALANCE_ACCOUNT_ID = "balanceAccountId"; + @Deprecated @SerializedName(SERIALIZED_NAME_BALANCE_ACCOUNT_ID) private String balanceAccountId; @@ -191,6 +192,7 @@ public DirectionEnum read(final JsonReader jsonReader) throws IOException { private PaymentInstrument paymentInstrument; public static final String SERIALIZED_NAME_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; + @Deprecated @SerializedName(SERIALIZED_NAME_PAYMENT_INSTRUMENT_ID) private String paymentInstrumentId; @@ -574,6 +576,7 @@ public void setBalanceAccount(ResourceReference balanceAccount) { } + @Deprecated public Transfer balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; @@ -593,6 +596,7 @@ public String getBalanceAccountId() { } + @Deprecated public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; } @@ -730,6 +734,7 @@ public void setPaymentInstrument(PaymentInstrument paymentInstrument) { } + @Deprecated public Transfer paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; @@ -749,6 +754,7 @@ public String getPaymentInstrumentId() { } + @Deprecated public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; } diff --git a/src/main/java/com/adyen/service/CapitalApi.java b/src/main/java/com/adyen/service/CapitalApi.java new file mode 100644 index 000000000..5fc729723 --- /dev/null +++ b/src/main/java/com/adyen/service/CapitalApi.java @@ -0,0 +1,128 @@ +/* + * Capital API + * Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. Learn more about [Adyen Capital](https://docs.adyen.com/marketplaces-and-platforms/capital). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ``` Alternatively, you can use the username and password to connect to the API using basic authentication. For example: ``` curl -H \"Content-Type: application/json\" \\ -U \"ws@BalancePlatform.YOUR_BALANCE_PLATFORM\":\"YOUR_WS_PASSWORD\" \\ ... ``` ## Roles and permissions To use the Capital API, you need an additional role for your API credential. Your Adyen contact will set up the roles and permissions for you. ## Versioning The Capital API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://balanceplatform-api-test.adyen.com/btl/v3/grants ``` ## Going live When going live, your Adyen contact will provide your API credential for the live environment. You can then use the username and password to send requests to `https://balanceplatform-api-live.adyen.com/btl/v3`. + * + * The version of the OpenAPI document: 3 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.service; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.capital.CapitalGrant; +import com.adyen.model.capital.CapitalGrantInfo; +import com.adyen.model.capital.CapitalGrants; +import com.adyen.model.capital.RestServiceError; +import com.adyen.model.RequestOptions; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class CapitalApi extends Service { + private final String baseURL; + + public CapitalApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://balanceplatform-api-test.adyen.com/btl/v3"); + } + + /** + * Get a capital account + * + * @return {@link CapitalGrants } + * @throws ApiException if fails to make API call + */ + public CapitalGrants getCapitalAccount() throws ApiException, IOException { + return getCapitalAccount(null, null); + } + + /** + * Get a capital account + * + * @param counterpartyAccountHolderId {@link String } Query: The counterparty account holder id. (optional) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CapitalGrants } + * @throws ApiException if fails to make API call + */ + public CapitalGrants getCapitalAccount(String counterpartyAccountHolderId, RequestOptions requestOptions) throws ApiException, IOException { + //Add query params + Map queryParams = new HashMap<>(); + if (counterpartyAccountHolderId != null) { + queryParams.put("counterpartyAccountHolderId", counterpartyAccountHolderId); + } + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/grants", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, null, queryParams); + return CapitalGrants.fromJson(jsonResult); + } + + /** + * Get grant reference details + * + * @param id {@link String } The unique identifier of the grant. (required) + * @return {@link CapitalGrant } + * @throws ApiException if fails to make API call + */ + public CapitalGrant getGrantReferenceDetails(String id) throws ApiException, IOException { + return getGrantReferenceDetails(id, null); + } + + /** + * Get grant reference details + * + * @param id {@link String } The unique identifier of the grant. (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CapitalGrant } + * @throws ApiException if fails to make API call + */ + public CapitalGrant getGrantReferenceDetails(String id, RequestOptions requestOptions) throws ApiException, IOException { + //Add path params + Map pathParams = new HashMap<>(); + if (id == null) { + throw new IllegalArgumentException("Please provide the id path parameter"); + } + pathParams.put("id", id); + + String requestBody = null; + Resource resource = new Resource(this, this.baseURL + "/grants/{id}", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.GET, pathParams); + return CapitalGrant.fromJson(jsonResult); + } + + /** + * Request a grant payout + * + * @param capitalGrantInfo {@link CapitalGrantInfo } (required) + * @return {@link CapitalGrant } + * @throws ApiException if fails to make API call + */ + public CapitalGrant requestGrantPayout(CapitalGrantInfo capitalGrantInfo) throws ApiException, IOException { + return requestGrantPayout(capitalGrantInfo, null); + } + + /** + * Request a grant payout + * + * @param capitalGrantInfo {@link CapitalGrantInfo } (required) + * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) + * @return {@link CapitalGrant } + * @throws ApiException if fails to make API call + */ + public CapitalGrant requestGrantPayout(CapitalGrantInfo capitalGrantInfo, RequestOptions requestOptions) throws ApiException, IOException { + + String requestBody = capitalGrantInfo.toJson(); + Resource resource = new Resource(this, this.baseURL + "/grants", null); + String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return CapitalGrant.fromJson(jsonResult); + } +} diff --git a/src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java b/src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java index 24213775e..f6734233d 100644 --- a/src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java +++ b/src/main/java/com/adyen/service/balanceplatform/BankAccountValidationApi.java @@ -36,7 +36,6 @@ public BankAccountValidationApi(Client client) { * Validate a bank account * * @param bankAccountIdentificationValidationRequest {@link BankAccountIdentificationValidationRequest } (required) - * @return void * @throws ApiException if fails to make API call */ public void validateBankAccountIdentification(BankAccountIdentificationValidationRequest bankAccountIdentificationValidationRequest) throws ApiException, IOException { @@ -48,7 +47,6 @@ public void validateBankAccountIdentification(BankAccountIdentificationValidatio * * @param bankAccountIdentificationValidationRequest {@link BankAccountIdentificationValidationRequest } (required) * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) - * @return void * @throws ApiException if fails to make API call */ public void validateBankAccountIdentification(BankAccountIdentificationValidationRequest bankAccountIdentificationValidationRequest, RequestOptions requestOptions) throws ApiException, IOException { diff --git a/src/main/java/com/adyen/service/legalentitymanagement/DocumentsApi.java b/src/main/java/com/adyen/service/legalentitymanagement/DocumentsApi.java index d1ff6e628..ac5f7d0da 100644 --- a/src/main/java/com/adyen/service/legalentitymanagement/DocumentsApi.java +++ b/src/main/java/com/adyen/service/legalentitymanagement/DocumentsApi.java @@ -36,7 +36,6 @@ public DocumentsApi(Client client) { * Delete a document * * @param id {@link String } The unique identifier of the document to be deleted. (required) - * @return {@link Object } * @throws ApiException if fails to make API call */ public void deleteDocument(String id) throws ApiException, IOException { @@ -48,7 +47,6 @@ public void deleteDocument(String id) throws ApiException, IOException { * * @param id {@link String } The unique identifier of the document to be deleted. (required) * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional) - * @return {@link Object } * @throws ApiException if fails to make API call */ public void deleteDocument(String id, RequestOptions requestOptions) throws ApiException, IOException { diff --git a/src/test/java/com/adyen/CapitalTest.java b/src/test/java/com/adyen/CapitalTest.java new file mode 100644 index 000000000..36ceb63d2 --- /dev/null +++ b/src/test/java/com/adyen/CapitalTest.java @@ -0,0 +1,50 @@ +package com.adyen; + +import com.adyen.constants.ApiConstants; +import com.adyen.model.capital.CapitalGrant; +import com.adyen.model.capital.CapitalGrantInfo; +import com.adyen.service.CapitalApi; +import org.junit.Test; + +import java.util.HashMap; + +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.verify; + +public class CapitalTest extends BaseTest { + + @Test + public void TestGetCapitalAccounts() throws Exception { + Client client = createMockClientFromFile("mocks/capital/get-capital-account.json"); + CapitalApi service = new CapitalApi(client); + com.adyen.model.capital.CapitalGrants response = service.getCapitalAccount(); + assertEquals(response.getGrants().get(0).getGrantOfferId(), "string"); + verify(client.getHttpClient()).request( + "https://balanceplatform-api-test.adyen.com/btl/v3/grants", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + new HashMap<>() + ); + } + + @Test + public void TestRequestGrant() throws Exception { + Client client = createMockClientFromFile("mocks/capital/request-grant.json"); + CapitalApi service = new CapitalApi(client); + CapitalGrant response = service.requestGrantPayout(new CapitalGrantInfo()); + assertEquals(response.getGrantAccountId(), "CG00000000000000000000001"); + verify(client.getHttpClient()).request( + "https://balanceplatform-api-test.adyen.com/btl/v3/grants", + "{}", + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.POST, + null + ); + } +} diff --git a/src/test/resources/mocks/capital/get-capital-account.json b/src/test/resources/mocks/capital/get-capital-account.json new file mode 100644 index 000000000..c0bd54ab4 --- /dev/null +++ b/src/test/resources/mocks/capital/get-capital-account.json @@ -0,0 +1,44 @@ +{ + "grants": [ + { + "amount": { + "currency": "str", + "value": 0 + }, + "balances": { + "currency": "string", + "fee": 0, + "principal": 0, + "total": 0 + }, + "counterparty": { + "accountHolderId": "string", + "balanceAccountId": "string", + "transferInstrumentId": "string" + }, + "fee": { + "amount": { + "currency": "str", + "value": 0 + } + }, + "grantAccountId": "987654321", + "grantOfferId": "string", + "id": "string", + "repayment": { + "basisPoints": 0, + "term": { + "estimatedDays": 0, + "maximumDays": 0 + }, + "threshold": { + "amount": { + "currency": "str", + "value": 0 + } + } + }, + "status": "Pending" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/mocks/capital/request-grant.json b/src/test/resources/mocks/capital/request-grant.json new file mode 100644 index 000000000..c37113a13 --- /dev/null +++ b/src/test/resources/mocks/capital/request-grant.json @@ -0,0 +1,31 @@ +{ + "id": "GR00000000000000000000001", + "grantAccountId": "CG00000000000000000000001", + "grantOfferId": "0000000000000001", + "counterparty": { + "accountHolderId": "AH00000000000000000000001", + "balanceAccountId": "BA00000000000000000000001" + }, + "amount": { + "currency": "EUR", + "value": 1000000 + }, + "fee": { + "amount": { + "value": 120000, + "currency": "EUR" + } + }, + "balances": + { + "currency": "EUR", + "fee": 120000, + "principal": 1000000, + "total": 1120000 + } + , + "repayment": { + "basisPoints": 1400 + }, + "status": "Pending" +} \ No newline at end of file